This repository has been archived by the owner on Aug 4, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove
get_*_operator
functions, simplify commoncrawl logic (#301)
* Remove `get_*_operator` functions, simplify commoncrawl logic * Only ignore the common folder, not all folders starting w/ common * Eliminate other uses of get operator functions
- Loading branch information
1 parent
6f5f598
commit 12f8000
Showing
11 changed files
with
149 additions
and
258 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Ignore all non-DAG files | ||
common | ||
common/ | ||
commoncrawl/commoncrawl_scripts | ||
providers/provider_api_scripts | ||
retired |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from airflow.providers.amazon.aws.hooks.s3 import S3Hook | ||
|
||
|
||
def load_file_to_s3(local_file, remote_key, bucket, aws_conn_id): | ||
s3 = S3Hook(aws_conn_id=aws_conn_id) | ||
s3.load_file(local_file, remote_key, replace=True, bucket_name=bucket) | ||
|
||
|
||
def get_load_s3_task_id(s3_key: str) -> str: | ||
return f"load_{s3_key.replace('/', '_').replace('.', '_')}_to_s3" |
Oops, something went wrong.