Implementation:Mage ai Mage ai Tableau Streams
Appearance
| Knowledge Sources | |
|---|---|
| Domains | Data_Integration, Tableau, Stream |
| Last Updated | 2026-02-09 00:00 GMT |
Overview
Stream class definitions for the Mage Tableau source connector, providing base, incremental, and full-table stream abstractions along with concrete implementations for Workbooks and Views.
Description
This module defines the Singer stream classes for the Tableau integration. The class hierarchy includes:
- BaseStream - Abstract base class with common stream properties (
tap_stream_id,replication_method,replication_key,key_properties,path,data_key,sub_data_key), parent data fetching, and epoch time conversion utilities. - IncrementalStream - Sets
replication_method = "INCREMENTAL". - FullTableStream - Sets
replication_method = "FULL_TABLE". - WorkbookList - Internal stream listing workbook IDs from the
/workbooksendpoint. Uses two-level response nesting (data_key+sub_data_key). Not replicated directly. - Workbooks - Fetches full workbook details using WorkbookList as parent. Extracts the
workbookkey from individual responses. - ViewList - Internal stream listing view IDs from the
/viewsendpoint. Not replicated directly. - Views - Fetches full view details using ViewList as parent. Extracts the
viewkey from individual responses.
Usage
Stream classes are instantiated with a TableauClient instance. The get_records method yields records for each stream.
Code Reference
Source Location
- Repository: mage-ai
- File:
mage_integrations/mage_integrations/sources/tableau/streams.py - Lines: 1-194
Signature
class BaseStream:
tap_stream_id = None
replication_method = None
replication_key = None
key_properties = []
data_key = None
sub_data_key = None
def __init__(self, client: TableauClient, logger=LOGGER):
Import
from mage_integrations.sources.tableau.streams import STREAMS, Workbooks, Views
Stream Classes
| Stream Class | tap_stream_id | Replication | Parent | Path | data_key / sub_data_key |
|---|---|---|---|---|---|
WorkbookList |
workbook_list | FULL_TABLE | None | workbooks | workbooks / workbook |
Workbooks |
workbooks | FULL_TABLE | WorkbookList | workbooks/{} | - |
ViewList |
view_list | FULL_TABLE | None | views | views / view |
Views |
views | FULL_TABLE | ViewList | views/{} | - |
Key Methods
| Method | Class | Description |
|---|---|---|
get_records(bookmark_datetime, is_parent) |
BaseStream | Abstract method; subclasses implement to yield records. |
get_parent_data(bookmark_datetime) |
BaseStream | Instantiates parent stream class and calls get_records with is_parent=True.
|
epoch_milliseconds_to_dt_str(timestamp) |
BaseStream | Static method converting epoch milliseconds to UTC datetime string. |
dt_to_epoch_seconds(dt_object) |
BaseStream | Static method converting datetime to epoch seconds. |
Usage Examples
from mage_integrations.sources.tableau.streams import STREAMS
stream_cls = STREAMS['workbooks']
stream = stream_cls(client=tableau_client, logger=logger)
for record in stream.get_records():
process(record)
Related Pages
Implements Principle
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment