-
Notifications
You must be signed in to change notification settings - Fork 5
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
0.1.1 Added source class for GCP BigQuery #56
Merged
tusharchou
merged 12 commits into
tusharchou:main
from
mrutunjay-kinagi:19-011-create-a-google-bigquery-client
Oct 29, 2024
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
eaac351
Added source class for GCP BigQuery
mrutunjay-kinagi f187171
Added source class for GCP BigQuery
mrutunjay-kinagi 61b3b5b
Removing old implementation of BigQuery
mrutunjay-kinagi 453e77c
Tested data on monthly reporting from BigQuery to CSV using Near Prot…
mrutunjay-kinagi 282334e
Tested data on monthly reporting from BigQuery to CSV using Near Prot…
mrutunjay-kinagi 6a93e50
Tested data on monthly reporting from BigQuery to CSV using Near Prot…
mrutunjay-kinagi 845ebd0
Tested data on monthly reporting from BigQuery to CSV
mrutunjay-kinagi fc43319
Code clean-up remving pycache
mrutunjay-kinagi 18675ee
Adding pycache to gitignore
mrutunjay-kinagi a8bd016
Updating Tests for GCP BigQuery
mrutunjay-kinagi b9f56d9
Updating doc string
mrutunjay-kinagi aef788d
Updating doc string
mrutunjay-kinagi 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 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,3 +3,4 @@ | |
.idea/modules.xml | ||
.idea/vcs.xml | ||
.idea/workspace.xml | ||
**/__pycache__/ |
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
Binary file removed
BIN
-199 Bytes
local-data-platform/local_data_platform/__pycache__/__init__.cpython-312.pyc
Binary file not shown.
Binary file removed
BIN
-350 Bytes
local-data-platform/local_data_platform/__pycache__/hello_world.cpython-312.pyc
Binary file not shown.
36 changes: 32 additions & 4 deletions
36
local-data-platform/local_data_platform/catalog/local/iceberg/__init__.py
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
41 changes: 41 additions & 0 deletions
41
local-data-platform/local_data_platform/pipeline/egression/csv_to_iceberg/__init__.py
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,41 @@ | ||
from local_data_platform.pipeline.egression import Egression | ||
from pyarrow import parquet, Table | ||
from local_data_platform.format.csv import CSV | ||
from local_data_platform.format.iceberg import Iceberg | ||
from local_data_platform import Config | ||
from local_data_platform.logger import log | ||
|
||
|
||
logger = log() | ||
|
||
|
||
class CSVToIceberg(Egression): | ||
""" | ||
CSVToIceberg is a class that handles the transformation of CSV data to Iceberg format. | ||
|
||
Attributes: | ||
source (CSV): The source CSV configuration. | ||
target (Iceberg): The target Iceberg configuration. | ||
|
||
Methods: | ||
__init__(config: Config, *args, **kwargs): | ||
Initializes the CSVToIceberg instance with the provided configuration. | ||
Logs the initialization process and sets up the source and target attributes. | ||
""" | ||
def __init__(self, config: Config, *args, **kwargs): | ||
logger.info( | ||
f""" | ||
Initialising CSVToIceberg with config {config} | ||
""" | ||
) | ||
self.source = config.metadata["source"] | ||
self.target = config.metadata["target"] | ||
self.source = CSV(name=self.source["name"], path=self.source["path"]) | ||
self.target = Iceberg(name=self.target["name"], catalog=self.target["catalog"]) | ||
logger.info( | ||
f""" | ||
CSVToIceberg initialised with | ||
source {self.source} | ||
target {self.target} | ||
""" | ||
) |
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.
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.
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.
@mrutunjay-kinagi what went wrong here?