-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
76 additions
and
84 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
import dlt | ||
from dlt.sources.credentials import ConnectionStringCredentials | ||
|
||
|
||
def read_sql_x( | ||
conn_str: ConnectionStringCredentials = dlt.secrets.value, | ||
query: str = dlt.config.value, | ||
|
@@ -15,17 +14,16 @@ def read_sql_x( | |
protocol="binary", | ||
) | ||
|
||
|
||
def genome_resource(): | ||
# create genome resource with merge on `upid` primary key | ||
genome = dlt.resource( | ||
name="genome", | ||
name="acanthochromis_polyacanthus", | ||
write_disposition="merge", | ||
primary_key="upid", | ||
primary_key="analysis_id", | ||
standalone=True, | ||
)(read_sql_x)( | ||
"mysql://[email protected]:4497/Rfam", # type: ignore[arg-type] | ||
"SELECT * FROM genome ORDER BY created LIMIT 1000", | ||
"mysql://[email protected]:3306/acanthochromis_polyacanthus_core_100_1", # type: ignore[arg-type] | ||
"SELECT * FROM analysis LIMIT 20", | ||
) | ||
# add incremental on created at | ||
genome.apply_hints(incremental=dlt.sources.incremental("created")) | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,13 +56,13 @@ def read_sql_x( | |
def genome_resource(): | ||
# create genome resource with merge on `upid` primary key | ||
genome = dlt.resource( | ||
name="genome", | ||
name="acanthochromis_polyacanthus", | ||
write_disposition="merge", | ||
primary_key="upid", | ||
primary_key="analysis_id", | ||
standalone=True, | ||
)(read_sql_x)( | ||
"mysql://[email protected]:4497/Rfam", # type: ignore[arg-type] | ||
"SELECT * FROM genome ORDER BY created LIMIT 1000", | ||
"mysql://[email protected]:3306/acanthochromis_polyacanthus_core_100_1", # type: ignore[arg-type] | ||
"SELECT * FROM analysis LIMIT 20", | ||
) | ||
# add incremental on created at | ||
genome.apply_hints(incremental=dlt.sources.incremental("created")) | ||
|
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
Oops, something went wrong.