-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[5/n][dagster-fivetran] Implement
FivetranWorkspaceData
to `Fivetra…
…nConnectorTableProps` method (#25797) ## Summary & Motivation This PR implements `FivetranWorkspaceData.to_fivetran_connector_table_props_data()`, a method that converts a `FivetranWorkspaceData` object to a list of FivetranConnectorTableProps. To create the asset spec, we need one `FivetranConnectorTableProps` object per connector table. This method parses the API raw data to create the FivetranConnectorTableProps` object, which is compatible with the `DagsterFivetranTranslator`. This will be used in the `defs_from_state` method of the stated-backed defs loader in a subsequent PR. ## How I Tested These Changes Additional unit test
- Loading branch information
1 parent
6e9d452
commit d6f4f52
Showing
7 changed files
with
114 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 3 additions & 6 deletions
9
...odules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_asset_specs.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 3 additions & 6 deletions
9
..._modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_resources.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...modules/libraries/dagster-fivetran/dagster_fivetran_tests/experimental/test_translator.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from typing import Callable | ||
|
||
from dagster_fivetran import FivetranWorkspace | ||
|
||
from dagster_fivetran_tests.experimental.conftest import TEST_API_KEY, TEST_API_SECRET | ||
|
||
|
||
def test_fivetran_workspace_data_to_fivetran_connector_table_props_data( | ||
fetch_workspace_data_api_mocks: Callable, | ||
) -> None: | ||
resource = FivetranWorkspace(api_key=TEST_API_KEY, api_secret=TEST_API_SECRET) | ||
|
||
actual_workspace_data = resource.fetch_fivetran_workspace_data() | ||
table_props_data = actual_workspace_data.to_fivetran_connector_table_props_data() | ||
assert len(table_props_data) == 4 | ||
assert table_props_data[0].table == "schema_name_in_destination_1.table_name_in_destination_1" | ||
assert table_props_data[1].table == "schema_name_in_destination_1.table_name_in_destination_2" | ||
assert table_props_data[2].table == "schema_name_in_destination_2.table_name_in_destination_1" | ||
assert table_props_data[3].table == "schema_name_in_destination_2.table_name_in_destination_2" |