-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: api to s3 * gzip content * check if already exist * feat: S3 parrquet * fix: test * fix: dependabot auto approuve
- Loading branch information
1 parent
60504e1
commit 1045a15
Showing
8 changed files
with
86 additions
and
28 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 |
---|---|---|
|
@@ -74,3 +74,12 @@ jobs: | |
SCW_ZONE: ${{ secrets.SCW_ZONE }} | ||
with: | ||
args: jobs definition update ${{ secrets.SCALEWAY_JOB_IMPORT_ID }} image-uri=${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/mediatree_import:${{ env.PROJECT_VERSION }} | ||
- name: update scaleway job definition with version s3 | ||
uses: jawher/[email protected] | ||
env: | ||
SCW_ACCESS_KEY: ${{ secrets.SCW_ACCESS_KEY }} | ||
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} | ||
SCW_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID }} | ||
SCW_ZONE: ${{ secrets.SCW_ZONE }} | ||
with: | ||
args: jobs definition update ${{ secrets.SCALEWAY_JOB_S3_ID }} image-uri=${{ secrets.CONTAINER_REGISTRY_ENDPOINT }}/s3:${{ env.PROJECT_VERSION }} |
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,6 +1,7 @@ | ||
secrets/pwd_api.txt | ||
secrets/username_api.txt | ||
secrets/* | ||
s3/* | ||
documents-experts/ | ||
cc-bio.json | ||
*.xlsx | ||
|
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 |
---|---|---|
@@ -1,17 +1,23 @@ | ||
import pytest | ||
import pandas as pd | ||
from quotaclimat.data_processing.mediatree.s3.api_to_s3 import get_bucket_key, save_to_s3 | ||
from quotaclimat.data_processing.mediatree.s3.api_to_s3 import get_bucket_key, save_to_s3, get_bucket_key_folder | ||
|
||
|
||
def test_get_bucket_key(): | ||
friday_6h26 = 1726719981 | ||
date = pd.to_datetime(friday_6h26, unit='s', utc=True) | ||
channel = "tf1" | ||
assert get_bucket_key(date, channel) == "year=2024/month=09/day=19/channel=tf1/data.json.gz" | ||
assert get_bucket_key(date, channel) == "year=2024/month=9/day=19/channel=tf1/*.parquet" | ||
|
||
|
||
def test_get_bucket_key_first_of_the_month(): | ||
first_december = 1733040125 | ||
date = pd.to_datetime(first_december, unit='s', utc=True) | ||
channel = "tf1" | ||
assert get_bucket_key(date, channel) == "year=2024/month=12/day=01/channel=tf1/data.json.gz" | ||
assert get_bucket_key(date, channel) == "year=2024/month=12/day=1/channel=tf1/*.parquet" | ||
|
||
def test_get_bucket_key_first_of_the_month(): | ||
first_december = 1733040125 | ||
date = pd.to_datetime(first_december, unit='s', utc=True) | ||
channel = "tf1" | ||
assert get_bucket_key_folder(date, channel) == "year=2024/month=12/day=1/channel=tf1/" |
1045a15
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.
Coverage Report