-
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.
[dagster-fivetran][docs] Migrate Fivetran docs to new doc site (#26485)
## Summary & Motivation Copy and migrate new Fivetran docs to new site, see original PR #26026 Removing `docs-to-migrate` tag from the original PR ## How I Tested These Changes BK.
- Loading branch information
1 parent
8e79df1
commit d32aab7
Showing
9 changed files
with
174 additions
and
29 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
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
d32aab7
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.
Deploy preview for dagster-docs-beta ready!
✅ Preview
https://dagster-docs-beta-2ra5pkvxy-elementl.vercel.app
Built with commit d32aab7.
This pull request is being automatically deployed with vercel-action