From 676da68a7c5ee17fb4e37ee3dbd38d96bf9ea85d Mon Sep 17 00:00:00 2001 From: github-actions Date: Thu, 6 Aug 2026 22:14:51 +0000 Subject: [PATCH 1/2] Release 1.72.0 --- .../configs/gooddata-api-client.yaml | 2 +- docs/config/production/params.toml | 10 +++++----- docs/layouts/index.redir | 5 +++-- gooddata-api-client/README.md | 2 +- .../gooddata_api_client/__init__.py | 2 +- .../gooddata_api_client/api_client.py | 2 +- .../gooddata_api_client/configuration.py | 2 +- gooddata-api-client/setup.py | 2 +- packages/gooddata-dbt/pyproject.toml | 4 ++-- packages/gooddata-eval/pyproject.toml | 4 ++-- packages/gooddata-fdw/pyproject.toml | 6 +++--- packages/gooddata-flexconnect/pyproject.toml | 8 ++++---- .../gooddata-flight-server/pyproject.toml | 4 ++-- packages/gooddata-pandas/pyproject.toml | 6 +++--- packages/gooddata-pipelines/pyproject.toml | 4 ++-- packages/gooddata-sdk/README.md | 2 +- packages/gooddata-sdk/pyproject.toml | 6 +++--- pyproject.toml | 4 ++-- uv.lock | 20 +++++++++---------- 19 files changed, 48 insertions(+), 47 deletions(-) diff --git a/.openapi-generator/configs/gooddata-api-client.yaml b/.openapi-generator/configs/gooddata-api-client.yaml index e8b19bcc2..d93fdc42c 100644 --- a/.openapi-generator/configs/gooddata-api-client.yaml +++ b/.openapi-generator/configs/gooddata-api-client.yaml @@ -6,7 +6,7 @@ infoName: "GoodData (generated by OpenAPI Generator)" infoEmail: "support@gooddata.com" projectName: gooddata-api-client packageName: gooddata_api_client -packageVersion: 1.71.0 +packageVersion: 1.72.0 library: urllib3 additionalProperties: licenseInfo: "MIT" diff --git a/docs/config/production/params.toml b/docs/config/production/params.toml index fdab47c4a..e0d4ae261 100644 --- a/docs/config/production/params.toml +++ b/docs/config/production/params.toml @@ -12,10 +12,14 @@ dirpath = "dev" url = "/dev/" sitemapExclude = true [[versions]] -version = "1.71" +version = "1.72" dirpath = "latest" url = "/latest/" [[versions]] +version = "1.71" +dirpath = "1.71" +url = "/1.71/" +[[versions]] version = "1.70" dirpath = "1.70" url = "/1.70/" @@ -23,7 +27,3 @@ url = "/1.70/" version = "1.69" dirpath = "1.69" url = "/1.69/" -[[versions]] -version = "1.68" -dirpath = "1.68" -url = "/1.68/" diff --git a/docs/layouts/index.redir b/docs/layouts/index.redir index 879b4e6db..b6b736308 100644 --- a/docs/layouts/index.redir +++ b/docs/layouts/index.redir @@ -1,8 +1,9 @@ # Redirect homepage to the latest version / {{ .Site.BaseURL }}/latest/ 301! /docs/ {{ .Site.BaseURL }}/latest/ 301! -/1.71/ {{ .Site.BaseURL }}/latest 301! -/1.71.0/ {{ .Site.BaseURL }}/latest 301! +/1.72/ {{ .Site.BaseURL }}/latest 301! +/1.72.0/ {{ .Site.BaseURL }}/latest 301! +/1.71.0/ {{ .Site.BaseURL }}/1.71 301! /1.70.0/ {{ .Site.BaseURL }}/1.70 301! /1.69.0/ {{ .Site.BaseURL }}/1.69 301! /1.68.0/ {{ .Site.BaseURL }}/1.68 301! diff --git a/gooddata-api-client/README.md b/gooddata-api-client/README.md index 50cd15826..0884f4f5e 100644 --- a/gooddata-api-client/README.md +++ b/gooddata-api-client/README.md @@ -4,7 +4,7 @@ No description provided (generated by Openapi Generator https://github.com/opena This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: v0 -- Package version: 1.71.0 +- Package version: 1.72.0 - Build package: org.openapitools.codegen.languages.PythonPriorClientCodegen ## Requirements. diff --git a/gooddata-api-client/gooddata_api_client/__init__.py b/gooddata-api-client/gooddata_api_client/__init__.py index 801d0b84f..c358f76e3 100644 --- a/gooddata-api-client/gooddata_api_client/__init__.py +++ b/gooddata-api-client/gooddata_api_client/__init__.py @@ -11,7 +11,7 @@ """ -__version__ = "1.71.0" +__version__ = "1.72.0" # import ApiClient from gooddata_api_client.api_client import ApiClient diff --git a/gooddata-api-client/gooddata_api_client/api_client.py b/gooddata-api-client/gooddata_api_client/api_client.py index 7127c80ab..d98f78deb 100644 --- a/gooddata-api-client/gooddata_api_client/api_client.py +++ b/gooddata-api-client/gooddata_api_client/api_client.py @@ -77,7 +77,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.71.0/python' + self.user_agent = 'OpenAPI-Generator/1.72.0/python' def __enter__(self): return self diff --git a/gooddata-api-client/gooddata_api_client/configuration.py b/gooddata-api-client/gooddata_api_client/configuration.py index 492bc3c1f..a7680b127 100644 --- a/gooddata-api-client/gooddata_api_client/configuration.py +++ b/gooddata-api-client/gooddata_api_client/configuration.py @@ -381,7 +381,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: v0\n"\ - "SDK Package Version: 1.71.0".\ + "SDK Package Version: 1.72.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/gooddata-api-client/setup.py b/gooddata-api-client/setup.py index 9e805fa18..f034f7aa0 100644 --- a/gooddata-api-client/setup.py +++ b/gooddata-api-client/setup.py @@ -16,7 +16,7 @@ long_description = (this_directory / "README.md").read_text(encoding="utf-8") NAME = "gooddata-api-client" -VERSION = "1.71.0" +VERSION = "1.72.0" # To install the library, run the following # # python setup.py install diff --git a/packages/gooddata-dbt/pyproject.toml b/packages/gooddata-dbt/pyproject.toml index 6a007aa7e..4ad7ad11a 100644 --- a/packages/gooddata-dbt/pyproject.toml +++ b/packages/gooddata-dbt/pyproject.toml @@ -1,7 +1,7 @@ # (C) 2025 GoodData Corporation [project] name = "gooddata-dbt" -version = "1.71.0" +version = "1.72.0" description = "dbt plugin for GoodData" readme = "README.md" license = "MIT" @@ -10,7 +10,7 @@ authors = [ ] requires-python = ">=3.10" dependencies = [ - "gooddata-sdk~=1.71.0", + "gooddata-sdk~=1.72.0", "pyyaml>=6.0", "attrs>=21.4.0,<=24.2.0", "cattrs>=22.1.0,<=24.1.1", diff --git a/packages/gooddata-eval/pyproject.toml b/packages/gooddata-eval/pyproject.toml index 2e543cb23..ee059136d 100644 --- a/packages/gooddata-eval/pyproject.toml +++ b/packages/gooddata-eval/pyproject.toml @@ -1,7 +1,7 @@ # (C) 2026 GoodData Corporation [project] name = "gooddata-eval" -version = "1.71.0" +version = "1.72.0" description = "Evaluate the GoodData AI agent against your own questions and models." readme = "README.md" license = "MIT" @@ -11,7 +11,7 @@ authors = [ keywords = ["gooddata", "ai", "evaluation", "llm", "analytics", "cli"] requires-python = ">=3.10" dependencies = [ - "gooddata-sdk~=1.71.0", + "gooddata-sdk~=1.72.0", "httpx>=0.27,<1.0", "orjson>=3.9.15,<4.0.0", "pydantic>=2.6,<3.0", diff --git a/packages/gooddata-fdw/pyproject.toml b/packages/gooddata-fdw/pyproject.toml index 4ce1811da..be3b7f976 100644 --- a/packages/gooddata-fdw/pyproject.toml +++ b/packages/gooddata-fdw/pyproject.toml @@ -1,7 +1,7 @@ # (C) 2025 GoodData Corporation [project] name = "gooddata-fdw" -version = "1.71.0" +version = "1.72.0" description = "GoodData Cloud Foreign Data Wrapper For PostgreSQL" readme = "README.md" license = "MIT" @@ -26,7 +26,7 @@ keywords = [ ] requires-python = ">=3.10" dependencies = [ - "gooddata-sdk~=1.71.0", + "gooddata-sdk~=1.72.0", # "multicorn>=1.4.0", # Uncommented as it was in original setup.py ] classifiers = [ @@ -44,7 +44,7 @@ classifiers = [ ] [project.urls] -Documentation = "https://gooddata-fdw.readthedocs.io/en/v1.71.0" +Documentation = "https://gooddata-fdw.readthedocs.io/en/v1.72.0" Source = "https://github.com/gooddata/gooddata-python-sdk" [dependency-groups] diff --git a/packages/gooddata-flexconnect/pyproject.toml b/packages/gooddata-flexconnect/pyproject.toml index 65be89123..8a3673c2a 100644 --- a/packages/gooddata-flexconnect/pyproject.toml +++ b/packages/gooddata-flexconnect/pyproject.toml @@ -1,7 +1,7 @@ # (C) 2025 GoodData Corporation [project] name = "gooddata-flexconnect" -version = "1.71.0" +version = "1.72.0" description = "Build your own data source for GoodData Cloud and GoodData Cloud Native." readme = "README.md" license = "MIT" @@ -29,8 +29,8 @@ keywords = [ requires-python = ">=3.10" dependencies = [ "dynaconf>=3.1.11,<4.0.0", - "gooddata-flight-server~=1.71.0", - "gooddata-sdk~=1.71.0", + "gooddata-flight-server~=1.72.0", + "gooddata-sdk~=1.72.0", "orjson>=3.9.15,<4.0.0", "pyarrow>=16.1.0", "structlog>=24.0.0,<25.0.0", @@ -50,7 +50,7 @@ classifiers = [ ] [project.urls] -Documentation = "https://gooddata-flexconnect.readthedocs.io/en/v1.71.0" +Documentation = "https://gooddata-flexconnect.readthedocs.io/en/v1.72.0" Source = "https://github.com/gooddata/gooddata-python-sdk" [dependency-groups] diff --git a/packages/gooddata-flight-server/pyproject.toml b/packages/gooddata-flight-server/pyproject.toml index 6098bfa10..38c639a44 100644 --- a/packages/gooddata-flight-server/pyproject.toml +++ b/packages/gooddata-flight-server/pyproject.toml @@ -1,7 +1,7 @@ # (C) 2025 GoodData Corporation [project] name = "gooddata-flight-server" -version = "1.71.0" +version = "1.72.0" description = "Flight RPC server to host custom functions" readme = "README.md" license = "MIT" @@ -52,7 +52,7 @@ classifiers = [ ] [project.urls] -Documentation = "https://gooddata-flight-server.readthedocs.io/en/v1.71.0" +Documentation = "https://gooddata-flight-server.readthedocs.io/en/v1.72.0" Source = "https://github.com/gooddata/gooddata-python-sdk" [project.scripts] diff --git a/packages/gooddata-pandas/pyproject.toml b/packages/gooddata-pandas/pyproject.toml index 2b27140eb..ff295f84f 100644 --- a/packages/gooddata-pandas/pyproject.toml +++ b/packages/gooddata-pandas/pyproject.toml @@ -1,7 +1,7 @@ # (C) 2025 GoodData Corporation [project] name = "gooddata-pandas" -version = "1.71.0" +version = "1.72.0" description = "GoodData Cloud to pandas" readme = "README.md" license = "MIT" @@ -29,7 +29,7 @@ keywords = [ ] requires-python = ">=3.10" dependencies = [ - "gooddata-sdk~=1.71.0", + "gooddata-sdk~=1.72.0", "pandas>=2.0.0,<3.0.0", ] classifiers = [ @@ -50,7 +50,7 @@ classifiers = [ arrow = ["pyarrow>=23.0.1", "orjson>=3.11.0"] [project.urls] -Documentation = "https://gooddata-pandas.readthedocs.io/en/v1.71.0" +Documentation = "https://gooddata-pandas.readthedocs.io/en/v1.72.0" Source = "https://github.com/gooddata/gooddata-python-sdk" [dependency-groups] diff --git a/packages/gooddata-pipelines/pyproject.toml b/packages/gooddata-pipelines/pyproject.toml index 9f56fcfd7..4e76c755b 100644 --- a/packages/gooddata-pipelines/pyproject.toml +++ b/packages/gooddata-pipelines/pyproject.toml @@ -1,7 +1,7 @@ # (C) 2025 GoodData Corporation [project] name = "gooddata-pipelines" -version = "1.71.0" +version = "1.72.0" description = "GoodData Cloud lifecycle automation pipelines" authors = [{ name = "GoodData", email = "support@gooddata.com" }] license = "MIT" @@ -11,7 +11,7 @@ dependencies = [ "pydantic (>=2.9.2,<3.0.0)", "requests (>=2.32.3,<3.0.0)", "types-requests (>1.0.0,<3.0.0)", - "gooddata-sdk~=1.71.0", + "gooddata-sdk~=1.72.0", "boto3 (>=1.39.3,<2.0.0)", "boto3-stubs (>=1.39.3,<2.0.0)", "azure-storage-blob (>=12.19.0,<13.0.0)", diff --git a/packages/gooddata-sdk/README.md b/packages/gooddata-sdk/README.md index c6fc13cf1..9e034797a 100644 --- a/packages/gooddata-sdk/README.md +++ b/packages/gooddata-sdk/README.md @@ -14,7 +14,7 @@ At the moment the SDK provides services to inspect and interact with the Semanti * Compute Service * Table Service -See [DOCUMENTATION](https://www.gooddata.ai/docs/python-sdk/1.71.0) for more details. +See [DOCUMENTATION](https://www.gooddata.ai/docs/python-sdk/1.72.0) for more details. ## Requirements diff --git a/packages/gooddata-sdk/pyproject.toml b/packages/gooddata-sdk/pyproject.toml index 55deb693f..756f3172e 100644 --- a/packages/gooddata-sdk/pyproject.toml +++ b/packages/gooddata-sdk/pyproject.toml @@ -1,7 +1,7 @@ # (C) 2025 GoodData Corporation [project] name = "gooddata-sdk" -version = "1.71.0" +version = "1.72.0" description = "GoodData Cloud Python SDK" readme = "README.md" license = "MIT" @@ -26,7 +26,7 @@ keywords = [ ] requires-python = ">=3.10,<4.0" dependencies = [ - "gooddata-api-client~=1.71.0", + "gooddata-api-client~=1.72.0", "python-dateutil>=2.5.3", "pyyaml>=6.0", "attrs>=21.4.0,<=24.2.0", @@ -54,7 +54,7 @@ classifiers = [ arrow = ["pyarrow>=23.0.1"] [project.urls] -Documentation = "https://www.gooddata.ai/docs/python-sdk/1.71.0" +Documentation = "https://www.gooddata.ai/docs/python-sdk/1.72.0" Source = "https://github.com/gooddata/gooddata-python-sdk" [project.scripts] diff --git a/pyproject.toml b/pyproject.toml index 1ea745e35..eede8acd9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ # (C) 2021 GoodData Corporation [project] name = "gooddata-python-sdk-workspace" -version = "1.71.0" +version = "1.72.0" description = "GoodData Python SDK Workspace" requires-python = ">=3.10" dependencies = [ @@ -150,7 +150,7 @@ extra-paths = [] # github_url = "https://github.com///" [tool.tbump.version] -current = "1.71.0" +current = "1.72.0" regex = ''' (?P\d+) \. diff --git a/uv.lock b/uv.lock index 2596bccdd..1151d3b3c 100644 --- a/uv.lock +++ b/uv.lock @@ -772,7 +772,7 @@ trusted-deps = [ [[package]] name = "gooddata-api-client" -version = "1.71.0" +version = "1.72.0" source = { editable = "gooddata-api-client" } dependencies = [ { name = "python-dateutil" }, @@ -799,7 +799,7 @@ wheels = [ [[package]] name = "gooddata-dbt" -version = "1.71.0" +version = "1.72.0" source = { editable = "packages/gooddata-dbt" } dependencies = [ { name = "attrs" }, @@ -836,7 +836,7 @@ test = [ [[package]] name = "gooddata-eval" -version = "1.71.0" +version = "1.72.0" source = { editable = "packages/gooddata-eval" } dependencies = [ { name = "gooddata-sdk" }, @@ -884,7 +884,7 @@ test = [ [[package]] name = "gooddata-fdw" -version = "1.71.0" +version = "1.72.0" source = { editable = "packages/gooddata-fdw" } dependencies = [ { name = "gooddata-sdk" }, @@ -917,7 +917,7 @@ test = [ [[package]] name = "gooddata-flexconnect" -version = "1.71.0" +version = "1.72.0" source = { editable = "packages/gooddata-flexconnect" } dependencies = [ { name = "dynaconf" }, @@ -956,7 +956,7 @@ test = [ [[package]] name = "gooddata-flight-server" -version = "1.71.0" +version = "1.72.0" source = { editable = "packages/gooddata-flight-server" } dependencies = [ { name = "dynaconf" }, @@ -997,7 +997,7 @@ test = [ [[package]] name = "gooddata-pandas" -version = "1.71.0" +version = "1.72.0" source = { editable = "packages/gooddata-pandas" } dependencies = [ { name = "gooddata-sdk" }, @@ -1051,7 +1051,7 @@ test = [ [[package]] name = "gooddata-pipelines" -version = "1.71.0" +version = "1.72.0" source = { editable = "packages/gooddata-pipelines" } dependencies = [ { name = "azure-identity" }, @@ -1100,7 +1100,7 @@ test = [ [[package]] name = "gooddata-python-sdk-workspace" -version = "1.71.0" +version = "1.72.0" source = { virtual = "." } dependencies = [ { name = "gooddata-api-client" }, @@ -1205,7 +1205,7 @@ type = [{ name = "ty", specifier = "~=0.0.55" }] [[package]] name = "gooddata-sdk" -version = "1.71.0" +version = "1.72.0" source = { editable = "packages/gooddata-sdk" } dependencies = [ { name = "attrs" }, From cbd27a1d3c51c9979ff6b2449f27c17191abf8cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Kr=C4=8Dma?= Date: Wed, 5 Aug 2026 14:21:27 +0200 Subject: [PATCH 2/2] feat: add new granularities JIRA: CQ-2758 risk: low --- .../execution-context/date-granularity.json | 4 ++ .../src/gooddata_pandas/arrow_convertor.py | 3 +- .../gooddata-pandas/tests/utils/test_utils.py | 6 +++ .../src/gooddata_sdk/compute/model/filter.py | 4 ++ .../src/gooddata_sdk/type_converter.py | 2 +- .../src/gooddata_sdk/visualization.py | 4 ++ .../tests/compute_model/test_date_filters.py | 37 +++++++++++++++++++ .../gooddata-sdk/tests/test_type_converter.py | 4 ++ 8 files changed, 62 insertions(+), 2 deletions(-) diff --git a/packages/gooddata-flexconnect/json_schemas/execution-context/date-granularity.json b/packages/gooddata-flexconnect/json_schemas/execution-context/date-granularity.json index 51948810a..a401dff32 100644 --- a/packages/gooddata-flexconnect/json_schemas/execution-context/date-granularity.json +++ b/packages/gooddata-flexconnect/json_schemas/execution-context/date-granularity.json @@ -5,6 +5,7 @@ "description": "All the supported granularities of the date attributes.", "enum": [ "TIMESTAMP", + "SECOND", "MINUTE", "HOUR", "DAY", @@ -12,7 +13,10 @@ "MONTH", "QUARTER", "YEAR", + "SECOND_OF_MINUTE", + "SECOND_OF_DAY", "MINUTE_OF_HOUR", + "MINUTE_OF_DAY", "HOUR_OF_DAY", "DAY_OF_WEEK", "DAY_OF_MONTH", diff --git a/packages/gooddata-pandas/src/gooddata_pandas/arrow_convertor.py b/packages/gooddata-pandas/src/gooddata_pandas/arrow_convertor.py index 8b2d8b6fe..93281d877 100644 --- a/packages/gooddata-pandas/src/gooddata_pandas/arrow_convertor.py +++ b/packages/gooddata-pandas/src/gooddata_pandas/arrow_convertor.py @@ -68,7 +68,7 @@ def _get_date_converter_for_label(label_id: str, model_labels: dict): - ``DAY`` / ``MONTH`` / ``YEAR`` → ``DateConverter`` (→ ``pandas.Timestamp`` via external fn) - ``WEEK`` / ``QUARTER`` → ``StringConverter`` (no-op) - - ``MINUTE`` / ``HOUR`` → ``DatetimeConverter`` + - ``SECOND`` / ``MINUTE`` / ``HOUR`` → ``DatetimeConverter`` - No granularity (text attrs) → ``None`` (caller skips conversion) """ info = model_labels.get(label_id, {}) @@ -84,6 +84,7 @@ def convert_label_values(label_id: str, values: list, model_labels: dict) -> lis Mirrors the non-Arrow execution path (``AttributeConverterStore`` in ``_typed_attribute_value``): - ``DAY`` / ``MONTH`` / ``YEAR`` granularity → ``pandas.Timestamp`` + - ``SECOND`` / ``MINUTE`` / ``HOUR`` → ``pandas.Timestamp`` - ``WEEK`` / ``QUARTER`` → ``str`` (unchanged) - No granularity (text attributes) → values returned as the **same object** diff --git a/packages/gooddata-pandas/tests/utils/test_utils.py b/packages/gooddata-pandas/tests/utils/test_utils.py index a532dca6b..3a623ca8f 100644 --- a/packages/gooddata-pandas/tests/utils/test_utils.py +++ b/packages/gooddata-pandas/tests/utils/test_utils.py @@ -59,6 +59,12 @@ def test_typed_attribute_values_batches_dates_to_timestamps(): pandas.Timestamp("2023-01-01"), pandas.Timestamp("2023-03-01"), ] + assert _typed_attribute_values( + _date_catalog_attribute("SECOND"), ["2026-07-31 12:34:56", "2026-12-31 23:59:59"] + ) == [ + pandas.Timestamp("2026-07-31 12:34:56"), + pandas.Timestamp("2026-12-31 23:59:59"), + ] def test_typed_attribute_values_week_and_quarter_stay_strings(): diff --git a/packages/gooddata-sdk/src/gooddata_sdk/compute/model/filter.py b/packages/gooddata-sdk/src/gooddata_sdk/compute/model/filter.py index 250988897..594723aa9 100644 --- a/packages/gooddata-sdk/src/gooddata_sdk/compute/model/filter.py +++ b/packages/gooddata-sdk/src/gooddata_sdk/compute/model/filter.py @@ -264,6 +264,7 @@ def __eq__(self, other: object) -> bool: "DAY", "HOUR", "MINUTE", + "SECOND", "QUARTER_OF_YEAR", "MONTH_OF_YEAR", "WEEK_OF_YEAR", @@ -272,6 +273,9 @@ def __eq__(self, other: object) -> bool: "DAY_OF_WEEK", "HOUR_OF_DAY", "MINUTE_OF_HOUR", + "MINUTE_OF_DAY", + "SECOND_OF_DAY", + "SECOND_OF_MINUTE", "FISCAL_MONTH", "FISCAL_QUARTER", "FISCAL_YEAR", diff --git a/packages/gooddata-sdk/src/gooddata_sdk/type_converter.py b/packages/gooddata-sdk/src/gooddata_sdk/type_converter.py index 0e0e70444..17a343deb 100644 --- a/packages/gooddata-sdk/src/gooddata_sdk/type_converter.py +++ b/packages/gooddata-sdk/src/gooddata_sdk/type_converter.py @@ -295,7 +295,7 @@ def build_stores() -> None: AttributeConverterStore.register("DATE", IntegerConverter) AttributeConverterStore.register("DATE", StringConverter, ["WEEK", "QUARTER"]) AttributeConverterStore.register("DATE", DateConverter, ["DAY", "MONTH", "YEAR"]) - AttributeConverterStore.register("DATE", DatetimeConverter, ["MINUTE", "HOUR"]) + AttributeConverterStore.register("DATE", DatetimeConverter, ["SECOND", "MINUTE", "HOUR"]) DBTypeConverterStore.register("date", DateConverter) DBTypeConverterStore.register("timestamp", DatetimeConverter) diff --git a/packages/gooddata-sdk/src/gooddata_sdk/visualization.py b/packages/gooddata-sdk/src/gooddata_sdk/visualization.py index 35e5a9c14..0f3adbcb4 100644 --- a/packages/gooddata-sdk/src/gooddata_sdk/visualization.py +++ b/packages/gooddata-sdk/src/gooddata_sdk/visualization.py @@ -49,6 +49,7 @@ "GDC.time.date": "DAY", "GDC.time.hour": "HOUR", "GDC.time.minute": "MINUTE", + "GDC.time.second": "SECOND", "GDC.time.quarter_in_year": "QUARTER_OF_YEAR", "GDC.time.month_in_year": "MONTH_OF_YEAR", "GDC.time.week_in_year": "WEEK_OF_YEAR", @@ -57,6 +58,9 @@ "GDC.time.day_in_week": "DAY_OF_WEEK", "GDC.time.hour_in_day": "HOUR_OF_DAY", "GDC.time.minute_in_hour": "MINUTE_OF_HOUR", + "GDC.time.minute_in_day": "MINUTE_OF_DAY", + "GDC.time.second_in_day": "SECOND_OF_DAY", + "GDC.time.second_in_minute": "SECOND_OF_MINUTE", "GDC.time.fiscal_month": "FISCAL_MONTH", "GDC.time.fiscal_quarter": "FISCAL_QUARTER", "GDC.time.fiscal_year": "FISCAL_YEAR", diff --git a/packages/gooddata-sdk/tests/compute_model/test_date_filters.py b/packages/gooddata-sdk/tests/compute_model/test_date_filters.py index 7d69f92a3..8b4350f2b 100644 --- a/packages/gooddata-sdk/tests/compute_model/test_date_filters.py +++ b/packages/gooddata-sdk/tests/compute_model/test_date_filters.py @@ -109,3 +109,40 @@ def test_date_filters_description(scenario, filter, descriptions): def test_all_time_date_filter_is_noop_by_default(): f = AllTimeDateFilter(dataset=ObjId(type="dataset", id="dataset.id")) assert f.is_noop() + + +@pytest.mark.parametrize( + "granularity", + [ + "YEAR", + "QUARTER", + "MONTH", + "WEEK", + "DAY", + "HOUR", + "MINUTE", + "SECOND", + "QUARTER_OF_YEAR", + "MONTH_OF_YEAR", + "WEEK_OF_YEAR", + "DAY_OF_YEAR", + "DAY_OF_MONTH", + "DAY_OF_WEEK", + "HOUR_OF_DAY", + "MINUTE_OF_HOUR", + "MINUTE_OF_DAY", + "SECOND_OF_DAY", + "SECOND_OF_MINUTE", + "FISCAL_MONTH", + "FISCAL_QUARTER", + "FISCAL_YEAR", + ], +) +def test_relative_date_filter_accepts_all_supported_granularities(granularity): + f = RelativeDateFilter( + dataset=ObjId(type="dataset", id="dataset.id"), + granularity=granularity, + from_shift=-30, + to_shift=-1, + ) + assert f.granularity == granularity diff --git a/packages/gooddata-sdk/tests/test_type_converter.py b/packages/gooddata-sdk/tests/test_type_converter.py index f1edc38c0..e118606b9 100644 --- a/packages/gooddata-sdk/tests/test_type_converter.py +++ b/packages/gooddata-sdk/tests/test_type_converter.py @@ -66,6 +66,10 @@ def test_to_type_ok(self): c = conv.DatetimeConverter() assert c.to_type(test_value) == datetime.datetime(2021, 10, 20, 11, 0) + def test_second_granularity_values_convert_to_datetime(self): + c = conv.AttributeConverterStore.find_converter("DATE", "SECOND") + assert c.to_type("2026-07-31 12:34:56") == datetime.datetime(2026, 7, 31, 12, 34, 56) + def test_to_type_wrong_val(self): test_value = "2021-10-20" c = conv.DatetimeConverter()