Skip to content

Commit 219b8eb

Browse files
committed
Add stream_alias to Catalog.to_dict. Add to unit test.
1 parent bdbd776 commit 219b8eb

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

singer/catalog.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ def to_dict(self):
5555
result['stream'] = self.stream
5656
if self.row_count is not None:
5757
result['row_count'] = self.row_count
58+
if self.stream_alias is not None:
59+
result['stream_alias'] = self.stream_alias
5860
if self.metadata is not None:
5961
result['metadata'] = self.metadata
6062
return result

tests/test_catalog.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class TestToDictAndFromDict(unittest.TestCase):
1010
{
1111
'stream': 'users',
1212
'tap_stream_id': 'prod_users',
13+
'stream_alias': 'users_alias',
1314
'database_name': 'prod',
1415
'table_name': 'users',
1516
'schema': {
@@ -42,6 +43,7 @@ class TestToDictAndFromDict(unittest.TestCase):
4243
CatalogEntry(
4344
stream='users',
4445
tap_stream_id='prod_users',
46+
stream_alias='users_alias',
4547
database='prod',
4648
table='users',
4749
schema=Schema(

0 commit comments

Comments
 (0)