-
Notifications
You must be signed in to change notification settings - Fork 10
V0.1.1 Adding pytest for bigquery #82
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
Closed
Closed
Changes from 26 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
8a57bc8
V0.1.1 (#58)
tusharchou d1c0894
0.1.1 BigQuery Release (#46)
tusharchou 72ab669
pypi release through github actions (#60)
tusharchou 0757da8
Create manual.yml
tusharchou cd2cbbe
Update publish.yml (#62)
tusharchou 80c8286
Update publish.yml (#63)
tusharchou 48efe67
Update pyproject.toml (#64)
tusharchou d1dbf62
Update publish.yml (#65)
tusharchou 7464490
Brmhastra patch 1 (#67)
brmhastra 773058f
Brmhastra patch 1 (#68)
brmhastra d3e26b7
Brmhastra patch 1 (#69)
brmhastra 840223e
GitHub workflow for pypi release (#70)
mrutunjay-kinagi e39db41
GitHub workflow for pypi release (#71)
mrutunjay-kinagi 8ab9414
Update publish.yml (#72)
mrutunjay-kinagi 11143b4
Update publish.yml (#73)
mrutunjay-kinagi c9d1101
Release v1.1 changes (#74)
mrutunjay-kinagi c3f2aa1
Github action setup for release v1.1 (#76)
mrutunjay-kinagi bf783b4
Update publish.yml
redpheonixx 9cb0189
Merge pull request #77 from tusharchou/redpheonixx-patch-1
redpheonixx 81eab88
Merge pull request #61 from tusharchou/tusharchou-patch-4
redpheonixx 00f5009
Update publish.yml (#78)
redpheonixx 28d5787
Update publish.yml
redpheonixx 5735908
Merge pull request #79 from tusharchou/redpheonixx-patch-3
redpheonixx 66b31b0
Update publish.yml (#80)
redpheonixx 6716cfd
Update pyproject.toml (#81)
redpheonixx f8c994a
Release v1.1 fix (#84)
mrutunjay-kinagi 4980033
0.1.1 Pytest Added for BigQuery Source (#86)
mrutunjay-kinagi 0e7e61d
fix(deps): Stabilize build dependencies and configuration
tusharchou ea64269
Merge pull request #95 from tusharchou/fix/stabilize-dependencies
redpheonixx 0c4c40f
Add restaurant_data_mart_PRD.md for managing restaurant data with LDP…
sankalpmodi94 09755aa
feat(dx): Add Makefile and setup guide (#96)
tusharchou 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,32 @@ | ||
| # This is a basic workflow that is manually triggered | ||
|
|
||
| name: Manual workflow | ||
|
|
||
| # Controls when the action will run. Workflow runs when manually triggered using the UI | ||
| # or API. | ||
| on: | ||
| workflow_dispatch: | ||
| # Inputs the workflow accepts. | ||
| inputs: | ||
| name: | ||
| # Friendly description to be shown in the UI instead of 'name' | ||
| description: 'Person to greet' | ||
| # Default value if no value is explicitly provided | ||
| default: 'World' | ||
| # Input has to be provided for the workflow to run | ||
| required: true | ||
| # The data type of the input | ||
| type: string | ||
|
|
||
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
| jobs: | ||
| # This workflow contains a single job called "greet" | ||
| greet: | ||
| # The type of runner that the job will run on | ||
| runs-on: ubuntu-latest | ||
|
|
||
| # Steps represent a sequence of tasks that will be executed as part of the job | ||
| steps: | ||
| # Runs a single command using the runners shell | ||
| - name: Send greeting | ||
| run: echo "Hello ${{ inputs.name }}" |
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,42 @@ | ||
| name: Upload Python Package to PyPI when a Release is Created | ||
|
|
||
| on: | ||
| release: | ||
| types: [created] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| pypi-publish: | ||
| name: Publish release to PyPI | ||
| runs-on: ubuntu-latest | ||
| environment: | ||
| name: production | ||
| url: https://pypi.org/p/local-data-platform | ||
| permissions: | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: "3.x" | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install setuptools wheel poetry==1.8 | ||
| cd local-data-platform | ||
| poetry install | ||
|
|
||
| - name: Build package | ||
| run: | | ||
| cd local-data-platform | ||
| poetry build | ||
|
|
||
| - name: Publish package to PyPI | ||
| uses: pypa/gh-action-pypi-publish@v1.11.0 | ||
| with: | ||
| packages-dir: local-data-platform/dist/ | ||
|
|
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,3 @@ | ||
| # Local Data Platform | ||
| Local Data Platform is a python library that uses open source tools to orchestrate a data platform operations locally for development and testing. <br/> | ||
| This library provides solutions for all stages ranging from ingestion to reporting all of which one can build data pipeline locally, test and easily scale up to cloud. |
Binary file not shown.
Binary file not shown.
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
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
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
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
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
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
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
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
11 changes: 8 additions & 3 deletions
11
local-data-platform/local_data_platform/pipeline/ingestion/__init__.py
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,11 +1,16 @@ | ||
| from local_data_platform.pipeline import Pipeline | ||
| from local_data_platform.logger import log | ||
|
|
||
| logger = log() | ||
|
|
||
| class Ingestion(Pipeline): | ||
|
|
||
| class Ingestion(Pipeline): | ||
|
|
||
| def extract(self): | ||
| self.source.get() | ||
| logger.info("Extracting Source in ingestion pipeline") | ||
| return self.source.get() | ||
|
|
||
| def load(self): | ||
| self.target.put(self.extract()) | ||
| df = self.extract() | ||
| logger.info(f"Loading Source {len(df)} in ingestion pipeline") | ||
| self.target.put(df) |
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
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
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
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
60 changes: 60 additions & 0 deletions
60
local-data-platform/real_world_use_cases/near_data_lake/reports/get_data.py
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,60 @@ | ||
| from local_data_platform.pipeline.ingestion.bigquery_to_csv import BigQueryToCSV | ||
| from local_data_platform import Config, SupportedFormat, SupportedEngine | ||
| from local_data_platform.store.source.json import Json | ||
| from local_data_platform.exceptions import PipelineNotFound | ||
| import os | ||
| from local_data_platform.logger import log | ||
|
|
||
|
|
||
| logger = log() | ||
|
|
||
|
|
||
| def get_near_transaction_dataset( | ||
| dataset="near_transactions", | ||
| config_path="/real_world_use_cases/near_data_lake/config/ingestion.json", | ||
| ): | ||
| """ | ||
| Retrieves and processes the near transaction dataset based on the provided configuration. | ||
|
|
||
| Args: | ||
| dataset (str): The name of the dataset to be processed. Defaults to "near_transactions". | ||
| config_path (str): The path to the configuration file. Defaults to "/real_world_use_cases/near_data_lake/config/ingestion.json". | ||
|
|
||
| Raises: | ||
| PipelineNotFound: If the source and target formats specified in the configuration are not supported. | ||
|
|
||
| Returns: | ||
| None | ||
| """ | ||
|
|
||
| config = Config( | ||
| **Json( | ||
| name=dataset, | ||
| path=config_path, | ||
| ).get() | ||
| ) | ||
| print(config) | ||
| logger.info( | ||
| f""" | ||
| We are using the following dictionary as the configuration to generate a monthly trust metric | ||
| {config} | ||
| """ | ||
| ) | ||
| if ( | ||
| config.metadata["source"]["format"] == SupportedFormat.JSON.value | ||
| and config.metadata["target"]["format"] == SupportedFormat.CSV.value | ||
| and config.metadata["source"]["engine"] == SupportedEngine.BIGQUERY.value | ||
| ): | ||
| data_loader = BigQueryToCSV(config=config) | ||
| data_loader.load() | ||
| else: | ||
| raise PipelineNotFound( | ||
| f""" | ||
| source {config.metadata['source']['format']} | ||
| to target {config.metadata['target']['format']} | ||
| pipeline is not supported yet | ||
| """ | ||
| ) | ||
|
|
||
|
|
||
| get_near_transaction_dataset() |
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.
why you have taken os.getcwd() twice, once as argument and other time concatenating ?
pls check