-
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
[dagster-fivetran][docs] Migrate Fivetran docs to new doc site #26485
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
18 changes: 0 additions & 18 deletions
18
examples/docs_beta_snippets/docs_beta_snippets/integrations/fivetran.py
This file was deleted.
Oops, something went wrong.
Empty file.
29 changes: 29 additions & 0 deletions
29
...s_beta_snippets/docs_beta_snippets/integrations/fivetran/customize_fivetran_asset_defs.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,29 @@ | ||
from dagster_fivetran import FivetranWorkspace, fivetran_assets | ||
|
||
import dagster as dg | ||
|
||
fivetran_workspace = FivetranWorkspace( | ||
account_id=dg.EnvVar("FIVETRAN_ACCOUNT_ID"), | ||
api_key=dg.EnvVar("FIVETRAN_API_KEY"), | ||
api_secret=dg.EnvVar("FIVETRAN_API_SECRET"), | ||
) | ||
|
||
|
||
@fivetran_assets( | ||
connector_id="fivetran_connector_id", | ||
name="fivetran_connector_id", | ||
group_name="fivetran_connector_id", | ||
workspace=fivetran_workspace, | ||
) | ||
def fivetran_connector_assets( | ||
context: dg.AssetExecutionContext, fivetran: FivetranWorkspace | ||
): | ||
# Do something before the materialization... | ||
yield from fivetran.sync_and_poll(context=context) | ||
# Do something after the materialization... | ||
|
||
|
||
defs = dg.Definitions( | ||
assets=[fivetran_connector_assets], | ||
resources={"fivetran": fivetran_workspace}, | ||
) |
33 changes: 33 additions & 0 deletions
33
...pets/docs_beta_snippets/integrations/fivetran/customize_fivetran_translator_asset_spec.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,33 @@ | ||
from dagster_fivetran import ( | ||
DagsterFivetranTranslator, | ||
FivetranConnectorTableProps, | ||
FivetranWorkspace, | ||
load_fivetran_asset_specs, | ||
) | ||
|
||
import dagster as dg | ||
|
||
fivetran_workspace = FivetranWorkspace( | ||
account_id=dg.EnvVar("FIVETRAN_ACCOUNT_ID"), | ||
api_key=dg.EnvVar("FIVETRAN_API_KEY"), | ||
api_secret=dg.EnvVar("FIVETRAN_API_SECRET"), | ||
) | ||
|
||
|
||
# A translator class lets us customize properties of the built | ||
# Fivetran assets, such as the owners or asset key | ||
class MyCustomFivetranTranslator(DagsterFivetranTranslator): | ||
def get_asset_spec(self, props: FivetranConnectorTableProps) -> dg.AssetSpec: | ||
# We create the default asset spec using super() | ||
default_spec = super().get_asset_spec(props) | ||
# We customize the metadata and asset key prefix for all assets | ||
return default_spec.replace_attributes( | ||
key=default_spec.key.with_prefix("prefix"), | ||
).merge_attributes(metadata={"custom": "metadata"}) | ||
|
||
|
||
fivetran_specs = load_fivetran_asset_specs( | ||
fivetran_workspace, dagster_fivetran_translator=MyCustomFivetranTranslator() | ||
) | ||
|
||
defs = dg.Definitions(assets=fivetran_specs, resources={"fivetran": fivetran_workspace}) |
26 changes: 26 additions & 0 deletions
26
...cs_beta_snippets/docs_beta_snippets/integrations/fivetran/multiple_fivetran_workspaces.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,26 @@ | ||
from dagster_fivetran import FivetranWorkspace, load_fivetran_asset_specs | ||
|
||
import dagster as dg | ||
|
||
sales_fivetran_workspace = FivetranWorkspace( | ||
account_id=dg.EnvVar("FIVETRAN_SALES_ACCOUNT_ID"), | ||
api_key=dg.EnvVar("FIVETRAN_SALES_API_KEY"), | ||
api_secret=dg.EnvVar("FIVETRAN_SALES_API_SECRET"), | ||
) | ||
marketing_fivetran_workspace = FivetranWorkspace( | ||
account_id=dg.EnvVar("FIVETRAN_MARKETING_ACCOUNT_ID"), | ||
api_key=dg.EnvVar("FIVETRAN_MARKETING_API_KEY"), | ||
api_secret=dg.EnvVar("FIVETRAN_MARKETING_API_SECRET"), | ||
) | ||
|
||
sales_fivetran_specs = load_fivetran_asset_specs(sales_fivetran_workspace) | ||
marketing_fivetran_specs = load_fivetran_asset_specs(marketing_fivetran_workspace) | ||
|
||
# Merge the specs into a single set of definitions | ||
defs = dg.Definitions( | ||
assets=[*sales_fivetran_specs, *marketing_fivetran_specs], | ||
resources={ | ||
"marketing_fivetran": marketing_fivetran_workspace, | ||
"sales_fivetran": sales_fivetran_workspace, | ||
}, | ||
) |
12 changes: 12 additions & 0 deletions
12
...cs_beta_snippets/docs_beta_snippets/integrations/fivetran/representing_fivetran_assets.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,12 @@ | ||
from dagster_fivetran import FivetranWorkspace, load_fivetran_asset_specs | ||
|
||
import dagster as dg | ||
|
||
fivetran_workspace = FivetranWorkspace( | ||
account_id=dg.EnvVar("FIVETRAN_ACCOUNT_ID"), | ||
api_key=dg.EnvVar("FIVETRAN_API_KEY"), | ||
api_secret=dg.EnvVar("FIVETRAN_API_SECRET"), | ||
) | ||
|
||
fivetran_specs = load_fivetran_asset_specs(fivetran_workspace) | ||
defs = dg.Definitions(assets=fivetran_specs, resources={"fivetran": fivetran_workspace}) |
16 changes: 16 additions & 0 deletions
16
...snippets/docs_beta_snippets/integrations/fivetran/sync_and_materialize_fivetran_assets.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,16 @@ | ||
from dagster_fivetran import FivetranWorkspace, build_fivetran_assets_definitions | ||
|
||
import dagster as dg | ||
|
||
fivetran_workspace = FivetranWorkspace( | ||
account_id=dg.EnvVar("FIVETRAN_ACCOUNT_ID"), | ||
api_key=dg.EnvVar("FIVETRAN_API_KEY"), | ||
api_secret=dg.EnvVar("FIVETRAN_API_SECRET"), | ||
) | ||
|
||
all_fivetran_assets = build_fivetran_assets_definitions(workspace=fivetran_workspace) | ||
|
||
defs = dg.Definitions( | ||
assets=all_fivetran_assets, | ||
resources={"fivetran": fivetran_workspace}, | ||
) |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
PyObject
components are creating an undefined. Is that specific to Fivetran or more broadly an issue with the new docs? If more broad we can merge and make a follow-up ticket to fix this.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.
I get the same PyObject not implemented yet error in the I/O manager guide that is already in the docs
In the I/O manager guide:
In the Fivetran docs:
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.
cc @neverett
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.
Yeah, I agree with @cmpadden -- let's merge this, and I'll make a ticket to follow up on
PyObject
implementation in new docs.