Skip to content

Commit

Permalink
Merge pull request #763 from dyvenia/add_viadot_source_to_bigquery_so…
Browse files Browse the repository at this point in the history
…urce

Add `_viadot_source` column to `BigQuery`
  • Loading branch information
Rafalz13 authored Oct 12, 2023
2 parents 39cfc03 + da7cce0 commit d437df0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added `Office365-REST-Python-Client` library to `requirements`
- Added `GetSalesQuotationData` view in `BusinessCore` source.
- Added new ViewType `queue_interaction_detail_view` to Genesys.
- Added new column `_viadot_source` to BigQuery extraction.

### Fixed

Expand Down
3 changes: 3 additions & 0 deletions viadot/sources/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from ..config import local_config
from ..exceptions import CredentialError, DBDataAccessError
from .base import Source
from ..utils import add_viadot_metadata_columns


class BigQuery(Source):
Expand Down Expand Up @@ -100,9 +101,11 @@ def get_project_id(self) -> str:
"""
return self.credentials["project_id"]

@add_viadot_metadata_columns()
def query_to_df(self, query: str) -> pd.DataFrame:
"""
Query throught Bigquery table.
`add_viadot_metadata_columns` adds one column to the DF - `_viadot_source`.
Args:
query (str): SQL-Like Query to return data values.
Expand Down

0 comments on commit d437df0

Please sign in to comment.