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

Fix fetch_runs_table method for state param usage #1253

Merged
merged 12 commits into from
Feb 22, 2023

Conversation

AleksanderWWW
Copy link
Contributor

@AleksanderWWW AleksanderWWW commented Feb 20, 2023

Before submitting checklist

  • Did you update the CHANGELOG? (not for test updates, internal changes/refactors or CI/CD setup)
  • Did you asked the docs owner to review all the updated user-facing interfaces?

@codecov
Copy link

codecov bot commented Feb 20, 2023

Codecov Report

Base: 73.59% // Head: 71.37% // Decreases project coverage by -2.23% ⚠️

Coverage data is based on head (9c36143) compared to base (2d8336d).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1253      +/-   ##
==========================================
- Coverage   73.59%   71.37%   -2.23%     
==========================================
  Files         281      281              
  Lines       13573    13585      +12     
==========================================
- Hits         9989     9696     -293     
- Misses       3584     3889     +305     
Flag Coverage Δ
unit ?
unit-pull-request 71.37% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/neptune/internal/utils/run_state.py 92.30% <100.00%> (+5.64%) ⬆️
src/neptune/metadata_containers/project.py 90.47% <100.00%> (+0.15%) ⬆️
src/neptune/new/constants.py 66.66% <0.00%> (-33.34%) ⬇️
src/neptune/legacy/model.py 51.19% <0.00%> (-27.39%) ⬇️
src/neptune/common/hardware/gauges/gauge.py 55.55% <0.00%> (-22.23%) ⬇️
...ptune/legacy/internal/api_clients/client_config.py 72.72% <0.00%> (-21.22%) ⬇️
src/neptune/legacy/backend.py 47.89% <0.00%> (-21.01%) ⬇️
...c/neptune/common/hardware/system/system_monitor.py 66.66% <0.00%> (-20.00%) ⬇️
.../common/hardware/resources/system_resource_info.py 76.00% <0.00%> (-20.00%) ⬇️
src/neptune/common/hardware/metrics/metric.py 80.85% <0.00%> (-19.15%) ⬇️
... and 61 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@AleksanderWWW AleksanderWWW marked this pull request as ready for review February 20, 2023 21:37
CHANGELOG.md Outdated
@@ -21,6 +21,7 @@
- Added exception for unsupported types ([#1229](https://github.com/neptune-ai/neptune-client/pull/1229))
- Change run status to Active / Inactive ([#1233](https://github.com/neptune-ai/neptune-client/pull/1233))
- Package renamed from `neptune-client` to `neptune` ([#1225](https://github.com/neptune-ai/neptune-client/pull/1225))
- Changed return values for run state ([#1253](https://github.com/neptune-ai/neptune-client/pull/1253))
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's change it to something about changing values for filtering runs table with the state. + Let's update the old one (Line 22) to something about returned values from the runs table state value.


@pytest.fixture(scope="session")
def project() -> Project:
return init_project(mode="read-only")
Copy link
Contributor

Choose a reason for hiding this comment

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

No need for this. debug + mock backend

assert not runs.empty
assert tag in runs["sys/tags"].values

def test_fetch_runs_table_with_incorrect_states(self, project):
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be just a unittest 😉. Check AbstractTablesTestMixin

@@ -155,3 +156,25 @@ def get_model_versions_as_rows(**kwargs):
return container.fetch_model_versions_table(**kwargs).to_rows()

self._test_fetch_from_container(init_run, get_model_versions_as_rows)

@pytest.mark.parametrize(
"state_active,state_inactive", [("active", "inactive"), ("Active", "Inactive"), ("aCTive", "inAcTiVE")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Same, let's just try to filter from API with some "new" value for state in e2e. In unittests -> Check that is case insensitive.

Copy link
Collaborator

@normandy7 normandy7 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@AleksanderWWW AleksanderWWW merged commit 94b5b19 into master Feb 22, 2023
@AleksanderWWW AleksanderWWW deleted the aw/fix_fetch_runs_by_state branch February 22, 2023 10:21
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.

3 participants