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

Expose production runs #17

Merged
merged 9 commits into from
Oct 17, 2023
Merged

Expose production runs #17

merged 9 commits into from
Oct 17, 2023

Conversation

denizs
Copy link
Member

@denizs denizs commented Oct 17, 2023

denizs and others added 8 commits September 22, 2023 11:16
this was causing spell and link checks to fail
☝️ This PR is the first in a row in an effort to expose
production runs via the ENLYZE SDK.

At the moment, we only expose time series data via the SDK and
interaction with the timeseries service is contained in the
`TimeseriesApiClient`. However, the new production runs API introduces a
different pagination pattern, which makes it inconvenient to generalize
the `TimeseriesApiClient` to a `EnlyzePlatformApiClient` ™️.
Thus, this and subsequent PRs are building on top of the assumption that
we will have separate API Clients for the timeseries and production runs
API.

This first PR introduces an `ApiBaseClient` class, which implement
generalized `get` and `get_paginated` methods. The latter calls two
abstract methods, `_has_more` and `_next_page_call_args` that must be
implemented by API clients deriving from this class.

---------

Co-authored-by: Daniel Krebs <[email protected]>
Building up on #14 , this PR introduces the `ProductionRunsApiClient`,
which instruments the Production Runs API. A subsequent PR will then
expose a `ProductionRun` user model via the `EnlyzeClient`.

---------

Co-authored-by: Daniel Krebs <[email protected]>
This PR exposes production runs via the `EnlyzeClient`. I would suggest
reviewing this PR commit by commit.

---------

Co-authored-by: Mohamed Attia <[email protected]>
Co-authored-by: Daniel Krebs <[email protected]>
@github-actions
Copy link

github-actions bot commented Oct 17, 2023

Coverage results

Update on 2023-10-17 15:12:39.846543633 +0000

This is the coverage report for commit c184a57

Name                                                                                   Stmts   Miss  Cover   Missing
--------------------------------------------------------------------------------------------------------------------
.tox/py311/lib/python3.11/site-packages/enlyze/__init__.py                                 4      0   100%
.tox/py311/lib/python3.11/site-packages/enlyze/api_clients/base.py                        65      0   100%
.tox/py311/lib/python3.11/site-packages/enlyze/api_clients/production_runs/client.py      20      0   100%
.tox/py311/lib/python3.11/site-packages/enlyze/api_clients/production_runs/models.py      50      0   100%
.tox/py311/lib/python3.11/site-packages/enlyze/api_clients/timeseries/client.py           19      0   100%
.tox/py311/lib/python3.11/site-packages/enlyze/api_clients/timeseries/models.py           34      0   100%
.tox/py311/lib/python3.11/site-packages/enlyze/auth.py                                    13      0   100%
.tox/py311/lib/python3.11/site-packages/enlyze/client.py                                  86      0   100%
.tox/py311/lib/python3.11/site-packages/enlyze/constants.py                                6      0   100%
.tox/py311/lib/python3.11/site-packages/enlyze/errors.py                                   3      0   100%
.tox/py311/lib/python3.11/site-packages/enlyze/models.py                                 107      0   100%
.tox/py311/lib/python3.11/site-packages/enlyze/validators.py                              38      0   100%
--------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                    445      0   100%

4 empty files skipped.

Copy link
Member

@daniel-k daniel-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

References to the to-be-merged PRs are missing. Please update the description.

src/enlyze/api_clients/production_runs/models.py Outdated Show resolved Hide resolved
@denizs denizs requested a review from daniel-k October 17, 2023 14:21
@denizs denizs requested a review from daniel-k October 17, 2023 15:19
Copy link
Member

@daniel-k daniel-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@denizs denizs merged commit 06c4aff into master Oct 17, 2023
6 checks passed
@denizs denizs deleted the feature/production-runs branch October 17, 2023 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants