Skip to content

Commit 8924ec1

Browse files
committed
fix parameter name in channel send func to filter
1 parent f9bed6e commit 8924ec1

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

cosmotech/coal/store/output/aws_channel.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, dct: Dotdict = None):
2525
self.configuration = Configuration(dct)
2626
self._s3 = S3(self.configuration)
2727

28-
def send(self, tables_filter: Optional[list[str]] = None) -> bool:
28+
def send(self, filter: Optional[list[str]] = None) -> bool:
2929

3030
_s = Store(store_location=self.configuration.cosmotech.parameters_absolute_path)
3131

@@ -43,8 +43,8 @@ def send(self, tables_filter: Optional[list[str]] = None) -> bool:
4343
self._s3.upload_file(_file_path, _uploaded_file_name)
4444
else:
4545
tables = list(_s.list_tables())
46-
if tables_filter:
47-
tables = [t for t in tables if t in tables_filter]
46+
if filter:
47+
tables = [t for t in tables if t in filter]
4848

4949
for table_name in tables:
5050
_data_stream = BytesIO()

cosmotech/coal/store/output/az_storage_channel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AzureStorageChannel(ChannelInterface):
2525
def __init__(self, dct: Dotdict = None):
2626
self.configuration = Configuration(dct)
2727

28-
def send(self, tables_filter: Optional[list[str]] = None) -> bool:
28+
def send(self, filter: Optional[list[str]] = None) -> bool:
2929
dump_store_to_azure(
3030
store_folder=self.configuration.cosmotech.dataset_absolute_path,
3131
account_name=self.configuration.azure.account_name,
@@ -35,7 +35,7 @@ def send(self, tables_filter: Optional[list[str]] = None) -> bool:
3535
client_secret=self.configuration.azure.client_secret,
3636
output_type=self.configuration.azure.output_type,
3737
file_prefix=self.configuration.azure.file_prefix,
38-
selected_tables=tables_filter,
38+
selected_tables=filter,
3939
)
4040

4141
def delete(self):

cosmotech/coal/store/output/postgres_channel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ class PostgresChannel(ChannelInterface):
2626
def __init__(self, dct: Dotdict = None):
2727
self.configuration = Configuration(dct)
2828

29-
def send(self, tables_filter: Optional[list[str]] = None) -> bool:
29+
def send(self, filter: Optional[list[str]] = None) -> bool:
3030
run_id = send_runner_metadata_to_postgresql(self.configuration)
3131
dump_store_to_postgresql_from_conf(
3232
self.configuration,
3333
store_folder=self.configuration.cosmotech.dataset_absolute_path,
34-
selected_tables=tables_filter,
34+
selected_tables=filter,
3535
fk_id=run_id,
3636
)
3737

tests/unit/coal/test_store/test_output/test_aws_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def test_send_with_tables_filter(self, mock_s3_class, mock_store_class):
170170
channel = AwsChannel(config)
171171

172172
# Act
173-
channel.send(tables_filter=["table1", "table3"])
173+
channel.send(filter=["table1", "table3"])
174174

175175
# Assert
176176
# Should only process table1 and table3

tests/unit/coal/test_store/test_output/test_az_storage_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def test_send_with_filter(self, mock_dump):
107107
tables_filter = ["table1", "table2"]
108108

109109
# Act
110-
channel.send(tables_filter=tables_filter)
110+
channel.send(filter=tables_filter)
111111

112112
# Assert
113113
mock_dump.assert_called_once_with(

tests/unit/coal/test_store/test_output/test_postgres_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def test_send_with_filter(self, mock_send_metadata, mock_dump):
122122
tables_filter = ["table1", "table2", "table3"]
123123

124124
# Act
125-
channel.send(tables_filter=tables_filter)
125+
channel.send(filter=tables_filter)
126126

127127
# Assert
128128
mock_send_metadata.assert_called_once()

0 commit comments

Comments
 (0)