Skip to content

Issue 48298: Align API Filter Operators #61

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

Merged
merged 2 commits into from
Aug 17, 2023
Merged

Issue 48298: Align API Filter Operators #61

merged 2 commits into from
Aug 17, 2023

Conversation

RosalineP
Copy link
Contributor

@RosalineP RosalineP commented Aug 16, 2023

Rationale

In the process of adding lineage filter operators to the APIs, I noticed a handful of inconsistencies I'm resolving across the APIs. See related pull requests.

Related Pull Requests

Changes

  • Add the following operators:
    • HAS_MISSING_VALUE
    • DOES_NOT_HAVE_MISSING_VALUE
    • Q
    • EXP_CHILD_OF
    • EXP_PARENT_OF
    • EXP_LINEAGE_OF
  • Add comments delineating operator types to align with other APIs
  • Rearrange ordering of operator types to align with other APIs
  • Update Change.txt

@RosalineP
Copy link
Contributor Author

Manual Test Plan

  • HAS_MISSING_VALUE, DOES_NOT_HAVE_MISSING_VALUE

    • Ensure missing value indicators are properly configured. Doc link for convenience: https://www.labkey.org/Documentation/wiki-page.view?name=manageMissing
    • Create a List with a field in which the Advanced Setting 'Track reason for missing data values' is true
    • Populate list with both missing values and populated values
    • Execute and verify results:
      • api.query.select_rows("lists", <List Name>, filter_array=[QueryFilter(<Field Name>, "", QueryFilter.Types. HAS_MISSING_VALUE)])
      • api.query.select_rows("lists", <List Name>, filter_array=[QueryFilter(<Field Name>, "", QueryFilter.Types.DOES_NOT_HAVE_MISSING_VALUE)])
  • Q

    • Create a list like the following: Screenshot 2023-08-16 at 3 44 29 PM
    • Execute:
      • api.query.select_rows("lists", <List Name>, filter_array=[QueryFilter("Field2", "one", QueryFilter.Types.Q)])
    • Verify results against UI results at url ending in /list-grid.view?name=<List Name>&query.Field2~Q=one
  • Lineage Filter Operators

    • Go into a SM folder

    • Create a sample type with no manually added fields

    • Create three samples, accepting defaults. Choose one of them (say it's S-3) and click 'Aliquot Selected', choosing two Aliquots per Parent, and accepting defaults for aliquot creation

    • Go to /query-executeQuery.view?schemaName=sampleManagement&query.queryName=SourceSamples and add the LSID column

    • QueryFilter.Types.EXP_LINEAGE_OF:

      • Execute:
      result = api.query.select_rows("sampleManagement", "SourceSamples", filter_array=[QueryFilter("lsid", '{json:[<LSID of     S-3>,10]}', QueryFilter.Types.EXP_LINEAGE_OF)])
      for row in result["rows"]:
          print(str(row['name']))
      
      • Verify results:
        • S-3-1
        • S-3-2
    • QueryFilter.Types.EXP_CHILD_OF:

      • Execute:
      result = api.query.select_rows("samples", <Sample Type Name>, filter_array=[QueryFilter("lsid", <LSID of S-3>, QueryFilter.Types.EXP_CHILD_OF)])
      for row in result["rows"]:
          print(str(row['Name']))
      
      • Verify results:
        • S-3-2
        • S-3-1
    • QueryFilter.Types.EXP_PARENT_OF:

      • Execute:
      result = api.query.select_rows("samples", <Sample Type Name>, filter_array=[QueryFilter("lsid", <LSID of S-3-1>, QueryFilter.Types.EXP_PARENT_OF)])
      for row in result["rows"]:
          print(str(row['Name']))
      
      • Verify results:
        • S-3

Copy link
Contributor

@labkey-alan labkey-alan 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 to me. Please update the __init__.py with the correct version, and the CHANGE.txt file with the correct date when merging and ping me so I can issue a release.

@RosalineP RosalineP merged commit 604cd15 into develop Aug 17, 2023
@RosalineP RosalineP deleted the fb_Issue48298 branch August 17, 2023 17: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