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

Add complex filters for RunMetaEntries #26

Merged
merged 15 commits into from
Nov 14, 2023
Merged

Add complex filters for RunMetaEntries #26

merged 15 commits into from
Nov 14, 2023

Conversation

meksor
Copy link
Contributor

@meksor meksor commented Oct 27, 2023

Adds a filter class for the RunMetaEntry model.
Enabling filters like:

backend.meta.tabulate(key__in=[...], run={"default_only":False})

Full current filterset from the OpenAPI spec:

{
  "id": 0,
  "type": "string",
  "run_id": 0,
  "key": "string",
  "value_int": 0,
  "value_str": "string",
  "value_float": 0,
  "value_bool": true,
  "id__in": [
    0
  ],
  "type__in": [
    "string"
  ],
  "type__like": "string",
  "type__ilike": "string",
  "type__notlike": "string",
  "type__notilike": "string",
  "run_id__in": [
    0
  ],
  "run_id__gt": 0,
  "run_id__lt": 0,
  "run_id__gte": 0,
  "run_id__lte": 0,
  "key__in": [
    "string"
  ],
  "key__like": "string",
  "key__ilike": "string",
  "key__notlike": "string",
  "key__notilike": "string",
  "value_int__in": [
    0
  ],
  "value_int__gt": 0,
  "value_int__lt": 0,
  "value_int__gte": 0,
  "value_int__lte": 0,
  "value_str__in": [
    "string"
  ],
  "value_str__like": "string",
  "value_str__ilike": "string",
  "value_str__notlike": "string",
  "value_str__notilike": "string",
  "value_float__in": [
    0
  ],
  "value_float__gt": 0,
  "value_float__lt": 0,
  "value_float__gte": 0,
  "value_float__lte": 0,
  "run": {
    "default_only": true,
    "is_default": true
  }
}

@meksor meksor marked this pull request as draft October 27, 2023 15:29
@glatterf42
Copy link
Member

Thanks for this template. The docs failure is my fault, I deleted the branch of my fork after sphinx-contrib/openapi merged my desired changes without first updating our dependency to their official version again. #27 is going to fix that, I'll then rebase this PR.

@glatterf42 glatterf42 added the enhancement New feature or request label Oct 31, 2023
@glatterf42 glatterf42 marked this pull request as ready for review October 31, 2023 11:15
@glatterf42
Copy link
Member

@danielhuppmann Is this complete and the behaviour as you envisioned?

@glatterf42
Copy link
Member

glatterf42 commented Oct 31, 2023

According to my local pytest run (pytest tests --cov=ixmp4), the new tests don't add a single line to the coverage. I'm not sure if I'm missing something here or if they are still useful.

@pmussak
Copy link
Contributor

pmussak commented Nov 2, 2023

According to my local pytest run (pytest tests --cov=ixmp4), the new tests don't add a single line to the coverage. I'm not sure if I'm missing something here or if they are still useful.

I reviewed the tests and I consider them useful. Although I am not familiar with the strategy for writing tests within this project.

I added tests to cover the filtering by meta-key.

@meksor meksor merged commit 64b65e3 into main Nov 14, 2023
4 checks passed
@glatterf42 glatterf42 deleted the feature/meta-filters branch November 14, 2023 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants