-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Parse new, merged data files from electricity consumption data #262
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7c987ba
WIP: Update electricity_sharepoint ingest to deal with merged files.
martyngigg 7beda15
Rework electricity sharepoint
martyngigg c317b2d
Sneak in a script to execute a query against the local Trino catalog
martyngigg a79373e
Remove dlt incremental loading that is confusing
martyngigg 862e859
Fix log statements
martyngigg 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 hidden or 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 @@ | ||
| #!/bin/bash | ||
| # shellcheck disable=1091 | ||
| # Execute scripts through Trino, connecting to the catalogs defined in the docker-compose.yml | ||
| # configuration. Authentication is enabled so connections require ssl and simply running | ||
| # 'docker compose exec trino' won't work. Instead connections go through Traefik that terminates | ||
| # the TLS connection. | ||
|
|
||
| if [ $# -ne 2 ]; then | ||
| echo "Usage: $0 <catalog_name> <args_for_execute>" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # single catalog argument | ||
| catalog=$1 | ||
| shift | ||
|
|
||
| # local environment | ||
| source "$(dirname "$0")/env-local" | ||
|
|
||
| docker run \ | ||
| --rm \ | ||
| --interactive \ | ||
| --tty \ | ||
| --network host \ | ||
| --env TRINO_PASSWORD="$TRINO_PASSWORD" \ | ||
| trinodb/trino:477 \ | ||
| trino \ | ||
| --user "$TRINO_USER" \ | ||
| --password \ | ||
| --server https://adp-router:58443 \ | ||
| --insecure \ | ||
| --catalog "$catalog" \ | ||
| --execute "$*" |
This file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
...oint/_electricity_sharepoint__sources.yml → ...oint/_electricity_sharepoint__sources.yml
This file contains hidden or 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 |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| version: 2 | ||
|
|
||
| sources: | ||
| - name: accelerator_electricity_sharepoint | ||
| - name: estates_electricity_sharepoint | ||
| database: facility_ops_landing | ||
| tables: | ||
| - name: rdm_data |
2 changes: 1 addition & 1 deletion
2
...t/stg_electricity_sharepoint_rdm_data.sql → ...t/stg_electricity_sharepoint_rdm_data.sql
This file contains hidden or 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
File renamed without changes.
5 changes: 0 additions & 5 deletions
5
warehouses/facility_ops_landing/ingest/accelerator/electricity_sharepoint/.dlt/config.toml
This file was deleted.
Oops, something went wrong.
170 changes: 0 additions & 170 deletions
170
.../facility_ops_landing/ingest/accelerator/electricity_sharepoint/electricity_sharepoint.py
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
warehouses/facility_ops_landing/ingest/estates/electricity_sharepoint/.dlt/config.toml
This file contains hidden or 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,4 @@ | ||
| [sources.electricity_sharepoint.rdm_data] | ||
| backfill = false | ||
| site_url = "https://stfc365.sharepoint.com/sites/ISISSustainability" | ||
| root_dir = "/General/RDM Data" | ||
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.
Uh oh!
There was an error while loading. Please reload this page.