Skip to content
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

Dataset refactor #617

Merged
merged 2 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion grai-integrations/source-bigquery/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "grai_source_bigquery"
version = "0.2.0"
version = "0.2.1"
description = ""
authors = ["Edward Louth <edward@grai.io>"]
license = "Elastic-2.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from grai_source_bigquery import adapters, base, loader, models, package_definitions
from grai_source_bigquery.package_definitions import config

__version__ = "0.2.0"
__version__ = "0.2.1"
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ def __init__(
):
self.namespace = get_from_env("namespace", "default") if namespace is None else namespace
self.project = get_from_env("project", required=False) if project is None else project
self.dataset = get_from_env("dataset", required=False) if dataset is None else dataset
self.datasets = [self.dataset] if isinstance(self.dataset, str) else self.dataset
dataset = get_from_env("dataset", required=False) if dataset is None else dataset
self.datasets = [dataset] if isinstance(dataset, str) else dataset

self.credentials = get_from_env("credentials", required=False) if credentials is None else credentials
self._connection: Optional[bigquery.connector.BigqueryConnection] = None
Expand Down Expand Up @@ -394,9 +394,7 @@ def logs(self) -> List[Any]:
f' AND timestamp>="{yesterday.strftime(time_format)}"'
)

datasets = [self.dataset] if isinstance(self.dataset, str) else self.dataset

for dataset in datasets:
for dataset in self.datasets:
filter_str += (
f' AND NOT protoPayload.metadata.jobChange.job.jobStats.queryStats.referencedTables="projects/grai-demo/datasets/{dataset}/tables/INFORMATION_SCHEMA.TABLES"'
f' AND NOT protoPayload.metadata.jobInsertion.job.jobStats.queryStats.referencedTables="projects/grai-demo/datasets/{dataset}/tables/INFORMATION_SCHEMA.TABLES"'
Expand Down
Loading