Skip to content
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

[8/n][dagster-airbyte] Implement load_airbyte_cloud_asset_specs #26269

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

maximearmstrong
Copy link
Contributor

@maximearmstrong maximearmstrong commented Dec 4, 2024

Summary & Motivation

This PR implements the load_airbyte_cloud_asset_specs function:

from dagster_airbyte import AirbyteCloudWorkspace, load_airbyte_cloud_asset_specs

import dagster as dg

airbyte_cloud_workspace = AirbyteCloudWorkspace(
    workspace_id=dg.EnvVar("AIRBYTE_CLOUD_WORKSPACE_ID"),
    client_id=dg.EnvVar("AIRBYTE_CLOUD_CLIENT_ID"),
    client_secret=dg.EnvVar("AIRBYTE_CLOUD_CLIENT_SECRET"),
)

airbyte_cloud_specs = load_airbyte_cloud_asset_specs(airbyte_cloud_workspace)
defs = dg.Definitions(assets=airbyte_cloud_specs, resources={"airbyte": airbyte_cloud_workspace}

How I Tested These Changes

Additional unit test

Changelog

[dagster-airbyte] The load_airbyte_cloud_asset_specs function is added. It can be used with the AirbyteCloudWorkspace resource and DagsterAirbyteTranslator translator to load your Airbyte Cloud connection streams as external assets in Dagster.

@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-7 branch from 661cd0c to 02a9165 Compare December 4, 2024 19:16
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-8 branch from d81b894 to bd93c69 Compare December 4, 2024 19:16
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-7 branch from 02a9165 to f5d6a1f Compare December 4, 2024 19:20
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-8 branch from bd93c69 to 1e2fea5 Compare December 4, 2024 19:20
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-7 branch from f5d6a1f to b849b85 Compare December 4, 2024 20:11
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-8 branch from 1e2fea5 to 9154fc9 Compare December 4, 2024 20:11
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-7 branch from b849b85 to b49c6ef Compare December 4, 2024 20:21
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-8 branch from 9154fc9 to 97d2b5a Compare December 4, 2024 20:21
@maximearmstrong maximearmstrong marked this pull request as ready for review December 4, 2024 20:38
@maximearmstrong maximearmstrong self-assigned this Dec 4, 2024


airbyte_cloud_specs = load_airbyte_cloud_asset_specs(airbyte_cloud_workspace)
defs = dg.Definitions(assets=airbyte_cloud_specs, resources={"airbyte": airbyte_cloud_workspace}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need the resource just to load asset specs right

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, good catch

Comment on lines 42 to 44
# 4 tables for the connector
assert len(all_assets) == 1
assert len(all_assets_keys) == 1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment seems completely unrelated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed - will fix

Comment on lines 46 to 48
# Sanity check outputs, translator tests cover details here
first_asset_key = next(key for key in all_assets_keys)
assert first_asset_key.path == ["test_prefix_test_stream"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

name the actual tests in question please

assert len(all_assets_keys) == 1

# Sanity check outputs, translator tests cover details here
first_asset_key = next(key for key in all_assets_keys)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should just call this the_asset_key since we expect one

@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-7 branch from b49c6ef to b3fd504 Compare December 5, 2024 20:54
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-8 branch from 97d2b5a to 929f117 Compare December 5, 2024 20:54
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-7 branch from b3fd504 to ca76f95 Compare December 5, 2024 21:18
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-8 branch from 929f117 to 0a494a8 Compare December 5, 2024 21:18
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-7 branch from ca76f95 to 9831074 Compare December 5, 2024 22:14
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-8 branch from 0a494a8 to 8c0d00a Compare December 5, 2024 22:14
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-7 branch from 9831074 to 5f467c2 Compare December 5, 2024 22:59
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-8 branch from 8c0d00a to 045ac16 Compare December 5, 2024 22:59
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-7 branch from 5f467c2 to 2007ef8 Compare December 5, 2024 23:14
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-8 branch from 045ac16 to cdb5323 Compare December 5, 2024 23:14
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-7 branch from 2007ef8 to 3630f44 Compare December 5, 2024 23:36
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-8 branch 2 times, most recently from 6f56cce to f578813 Compare December 5, 2024 23:39
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-7 branch from d48ba20 to 4648e5c Compare December 5, 2024 23:50
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-8 branch from f578813 to cd95ca5 Compare December 5, 2024 23:50
Base automatically changed from maxime/rework-airbyte-cloud-7 to master December 6, 2024 00:07
@maximearmstrong maximearmstrong force-pushed the maxime/rework-airbyte-cloud-8 branch from cd95ca5 to 72c6a47 Compare December 6, 2024 00:07
@maximearmstrong maximearmstrong merged commit e341385 into master Dec 6, 2024
1 check passed
@maximearmstrong maximearmstrong deleted the maxime/rework-airbyte-cloud-8 branch December 6, 2024 00:25
pskinnerthyme pushed a commit to pskinnerthyme/dagster that referenced this pull request Dec 16, 2024
…ter-io#26269)

## Summary & Motivation

This PR implements the `load_airbyte_cloud_asset_specs` function:

```python
from dagster_airbyte import AirbyteCloudWorkspace, load_airbyte_cloud_asset_specs

import dagster as dg

airbyte_cloud_workspace = AirbyteCloudWorkspace(
    workspace_id=dg.EnvVar("AIRBYTE_CLOUD_WORKSPACE_ID"),
    client_id=dg.EnvVar("AIRBYTE_CLOUD_CLIENT_ID"),
    client_secret=dg.EnvVar("AIRBYTE_CLOUD_CLIENT_SECRET"),
)

airbyte_cloud_specs = load_airbyte_cloud_asset_specs(airbyte_cloud_workspace)
defs = dg.Definitions(assets=airbyte_cloud_specs, resources={"airbyte": airbyte_cloud_workspace}
```

## How I Tested These Changes

Additional unit test

## Changelog

[dagster-airbyte] The `load_airbyte_cloud_asset_specs` function is
added. It can be used with the `AirbyteCloudWorkspace` resource and
`DagsterAirbyteTranslator` translator to load your Airbyte Cloud
connection streams as external assets in Dagster.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants