Skip to content

Commit

Permalink
fix: wrong url paths for hosted_extractors.jobs.list_logs and list_me…
Browse files Browse the repository at this point in the history
…trics (#2038)
  • Loading branch information
haakonvt authored Nov 20, 2024
1 parent 578825b commit a55fec4
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 26 deletions.
34 changes: 19 additions & 15 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ Changes are grouped as follows
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

## [7.67.2] - 2023-11-19
## [7.67.3] - 2024-11-20
### Fixed
- Fixed wrong url paths for `client.hosted_extractors.jobs.[list_logs, list_metrics]`

## [7.67.2] - 2024-11-19
### Added
- Instance ID is now supported for DatapointsSubscriptionsAPI (`client.time_series.subscriptions`)

Expand Down Expand Up @@ -53,24 +57,24 @@ Changes are grouped as follows
You may control memory usage by specifying how many time series to fetch in parallel with the
`chunk_size_time_series` parameter, and datapoints with `chunk_size_datapoints`.

## [7.64.14] - 2024-11-11
## [7.64.14] - 2024-11-12
### Added
- [Feature Preview - beta] Adding data modeling triggers support for data workflows.

## [7.64.13] - 2024-11-12
### Added
- Added new `SAPWriteback` and `SAPWritebackRequests` capabilities.

## [7.64.12] - 2024-11-11
## [7.64.12] - 2024-11-12
### Fixed
- `FunctionSchedulesAPI.__call__()` calls `FunctionSchedulesAPI.list()` instead of `APIClient._list_generator()`.
(The latter relied on pagination, which was not implemented by `/schedules/list`).

## [7.64.11] - 2024-11-10
## [7.64.11] - 2024-11-12
### Added
- [Feature Preview - alpha] Support for `PostgresGateway` `Tables` `client.postegres_gateway.tables`.

## [7.64.10] - 2024-11-10
## [7.64.10] - 2024-11-12
### Fixed
- [Feature Preview - alpha] Updated `PostgresGateway` `Users` `client.postegres_gateway.users` to changes in the API.

Expand All @@ -87,7 +91,7 @@ Changes are grouped as follows
- Set batch size to 10 for `create` and `update` of hosted extractor jobs, destinations, sources and mappings
to avoid hitting the API limits.

## [7.64.6] - 2024-10-22
## [7.64.6] - 2024-11-02
### Added
- Data modeling filters now support the use of `NodeId` (and `EdgeId`) directly.

Expand Down Expand Up @@ -341,13 +345,13 @@ Changes are grouped as follows
### Fixed
- Missing exports for workflow triggers

## [7.55.0] - 2024-08-23
## [7.55.0] - 2024-08-27
### Added
- Support for creating a session using a one-shot token in the `client.iam.session.create` method.
- Parameter `nonce` to the `client.functions.call()` and `client.workflow.executions.run()` methods to allow passing
a custom nonce instead of letting the SDK generate it from your current credentials.

## [7.54.19] - 2024-08-23
## [7.54.19] - 2024-08-27
### Added
- [Feature Preview - beta] Support for `client.workflows.triggers`.

Expand Down Expand Up @@ -568,11 +572,11 @@ Changes are grouped as follows
occur without warning. Set beta header to avoid warning. Users of `retrieve_dataframe_in_tz` should
consider preparing to upgrade as soon as the features reach general availability (GA).

## [7.44.1] - 2024-05-24
## [7.44.1] - 2024-05-29
### Added
- Missing parameter `timeout` to `client.transformations.preview`.

## [7.44.0] - 2024-05-24
## [7.44.0] - 2024-05-29
### Added
- New utility function `datetime_to_ms_iso_timestamp` in `cognite.client.utils` to convert a datetime object
to a string representing a timestamp in the format expected by the Cognite GraphQL API.
Expand Down Expand Up @@ -819,7 +823,7 @@ Changes are grouped as follows
bounded memory usage profile (for when the caller's code isn't processing fast enough to keep up). Worth noting
that this has no effect on the total retrieval time.

## [7.27.0] - 2024-03-04
## [7.27.0] - 2024-03-06
### Added
- Added support for multipart file uploads using the `client.files.multipart_upload_session` method.

Expand Down Expand Up @@ -894,7 +898,7 @@ Changes are grouped as follows
### Fixed
- Data Workflows: mark parameter `jobId` as optional in `TransformationTaskOutput`, as it may not be populated in case of a failure.

## [7.21.0] - 2024-02-10
## [7.21.0] - 2024-02-20
### Added
- Parameter `sort` to `client.documents.list`.

Expand Down Expand Up @@ -1007,7 +1011,7 @@ Changes are grouped as follows
### Added
- EdgeConnection, MultiEdgeConnection, MultiReverseDirectRelation and their corresponding Apply View dataclasses are now importable from `cognite.client.dataclasses.data_modeling`.

## [7.13.4] - 2024-01-11
## [7.13.4] - 2024-01-13
### Fixed
- When calling `WorkflowExecution.load` not having a `schedule` would raise a `KeyError` even though it is optional. This is now fixed.
- When calling `Datapoints.load` not having a `isString` would raise a `KeyError` even though it is optional. This is now fixed.
Expand Down Expand Up @@ -1545,7 +1549,7 @@ Support for setting and fetching TimeSeries and Datapoints with "real" units (`u
### Added
- Support for the WorkflowOrchestrationAPI with the implementation `client.workflows`.

## [6.27.0] - 2023-09-13
## [6.27.0] - 2023-09-24
### Changed
- Reduce concurrency in data modeling client to 1

Expand All @@ -1559,7 +1563,7 @@ of `time_series.subscriptions.iterate_data`.
### Added
- Support for setting and retrieving `data_set_id` in data class `client.data_classes.ThreeDModel`.

## [6.25.2] - 2023-09-12
## [6.25.2] - 2023-09-17
### Fixed
- Using the `HasData` filter would raise an API error in CDF.

Expand Down
3 changes: 2 additions & 1 deletion cognite/client/_api/hosted_extractors/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def __call__(
Iterator[Job] | Iterator[JobList]: yields Job one by one if chunk_size is not specified, else JobList objects.
"""
self._warning.warn()

return self._list_generator(
list_cls=JobList,
resource_cls=Job,
Expand Down Expand Up @@ -320,6 +319,7 @@ def list_logs(
filter_["destination"] = destination

return self._list(
url_path=self._RESOURCE_PATH + "/logs",
list_cls=JobLogsList,
resource_cls=JobLogs,
filter=filter_ or None,
Expand Down Expand Up @@ -364,6 +364,7 @@ def list_metrics(
filter_["destination"] = destination

return self._list(
url_path=self._RESOURCE_PATH + "/metrics",
list_cls=JobMetricsList,
resource_cls=JobMetrics,
filter=filter_ or None,
Expand Down
2 changes: 1 addition & 1 deletion cognite/client/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import annotations

__version__ = "7.67.2"
__version__ = "7.67.3"
__api_subversion__ = "20230101"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "cognite-sdk"

version = "7.67.2"
version = "7.67.3"
description = "Cognite Python SDK"
readme = "README.md"
documentation = "https://cognite-sdk-python.readthedocs-hosted.com"
Expand Down
12 changes: 7 additions & 5 deletions scripts/custom_checks/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@ def changelog_entry_date() -> str | None:
return f"Date given in the newest entry in 'CHANGELOG.md', {date!r}, is not valid/parsable (YYYY-MM-DD)"


def version_number_is_increasing() -> str | None:
versions = [Version(match.group(1)) for match in _parse_changelog()]
for new, old in pairwise(versions):
if new < old:
return f"Versions must be strictly increasing: {new} is not higher than the previous, {old}."
def version_number_and_date_is_increasing() -> str | None:
versions_and_dates = [(Version(m.group(1)), datetime.strptime(m.group(2), "%Y-%m-%d")) for m in _parse_changelog()]
for (new_v, new_d), (old_v, old_d) in pairwise(versions_and_dates):
if new_v < old_v:
return f"Versions must be strictly increasing: {new_v} is not higher than the previous, {old_v}."
if new_d < old_d:
return f"Dates must be strictly increasing: {new_d.date()} is not after than the previous, {old_d.date()}."
return None
6 changes: 3 additions & 3 deletions scripts/run_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
changelog_entry_date,
changelog_entry_version_matches,
pyproj_version_matches,
version_number_is_increasing,
version_number_and_date_is_increasing,
)


Expand All @@ -17,13 +17,13 @@ def run_checks(files: list[Path]) -> list[str | None]:
pyproj_version_matches(),
changelog_entry_version_matches(),
changelog_entry_date(),
version_number_is_increasing(),
version_number_and_date_is_increasing(),
format_docstrings(files),
]


if __name__ == "__main__":
files = tuple(map(Path, sys.argv[1:]))
if failed := list(filter(None, run_checks(files))):
print("\n\n".join(failed))
print(f"\nCustom repo checks failures:\n{'#' * 80}\n" + "\n\n".join(failed))
raise SystemExit(1)

0 comments on commit a55fec4

Please sign in to comment.