-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[11/n][dagster-fivetran] Implement materialization method in FivetranWorkspace #25961
base: maxime/use-translator-instance-in-load-fivetran-asset-specs
Are you sure you want to change the base?
[11/n][dagster-fivetran] Implement materialization method in FivetranWorkspace #25961
Conversation
FivetranWorkspaceData
to FivetranConnectorTableProps
method
#25797
self._make_connector_request( | ||
method="GET", | ||
endpoint=f"{connector_id}/schemas/{schema_name}/tables/{table_name}/columns", | ||
) | ||
return self._make_request("GET", f"connectors/{connector_id}/schemas") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There appears to be a mismatch between the API call and its return value. The method makes a request for column data via _make_connector_request()
but then discards that result and returns schema config data instead. To fix this, replace the two calls with a single return:
return self._make_connector_request(
method='GET',
endpoint=f'{connector_id}/schemas/{schema_name}/tables/{table_name}/columns'
)
This will properly return the column data that was requested.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
"An error occurred while fetching column metadata for table %s", | ||
f"Exception: {e}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The string formatting appears incorrect here. The %s
placeholder expects a value to substitute, but the second argument is an f-string that's already been evaluated. To properly log both the table info and exception, consider:
self._log.warning("An error occurred while fetching column metadata: %s", str(e))
or if table information is needed:
self._log.warning(
"An error occurred while fetching column metadata for table %s: %s",
f"{schema_source_name}.{table_source_name}",
str(e)
)
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
0521c7f
to
6e115f1
Compare
0e0b1e2
to
78fe129
Compare
6e115f1
to
e07232e
Compare
78fe129
to
d3f1bf6
Compare
e07232e
to
3be662b
Compare
d3f1bf6
to
b9e54d6
Compare
3be662b
to
5a87eb7
Compare
b417e4e
to
3150e3e
Compare
ebca057
to
4f7cd9a
Compare
671a135
to
9c79c37
Compare
4f7cd9a
to
5f1b3f8
Compare
9c79c37
to
a44f40b
Compare
5f1b3f8
to
f78ad58
Compare
a44f40b
to
8fef279
Compare
f78ad58
to
44865a4
Compare
8fef279
to
22d80d7
Compare
44865a4
to
a83dfc6
Compare
22d80d7
to
6fe328f
Compare
a83dfc6
to
ebe8457
Compare
6fe328f
to
c16e280
Compare
ebe8457
to
748298f
Compare
c16e280
to
2df7622
Compare
d2fa78b
to
67d0fcd
Compare
2df7622
to
3317a7d
Compare
67d0fcd
to
6cf70a0
Compare
3317a7d
to
b0e8961
Compare
Summary & Motivation
This PR implements
FivetranWorkspace.sync_and_poll
, the materialization method for Fivetran assets. This method:FivetranClient.sync_and_poll
FivetranClient.sync_and_poll
and generates the asset materializationsMaterializeResult
for each expected asset andAssetMaterialization
for each unexpected assetCan be leveraged like:
How I Tested These Changes
Additional tests with BK
Tested with a live Fivetran instance:
Changelog
[dagster-fivetran]