-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat(pyclient): add support for GraphQL API to 'get' method #4558
base: master
Are you sure you want to change the base?
Conversation
* added column types to new constants.py * started creating 'get_pkeys' for metadata.py
* finished '_parse_get_table_query' method
|
* added remaining types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review:
- Looks good and makes sense
Functional tests:
Truncate table
- Truncate table works fine
- Reference from other table => Referenced by Exception
Get as_df = False or not included NOT APPROVED:
- ref/ontology column values are not returned as 'country': 'US', but as 'country': {'name': 'US'}. This is very inconvenient and for sure will break existing scripts.
- Get from an empty table returns a NoneType, where I would expect an empty list with len = 0
- Tested with biobank_directory template (with demo-data), not able to fetch from Collections and CollectionFacts: Table with id 'DiseaseTypes' not found in schema 'DieuwkesTest' => DiseaseTypes is in another schema, but not referenced as an ontology, but as a ref. F.e. Biobanks has also refs to other schema, but these are all real ontologies and this table can be fetched.
- Datatypes: bools go fine
- string type columns with decimal value with zero at the end go fine
- Empty columns are not returned (which is OK)
Get as_df = True:
- Retrieve data from an empty tables returns and empty dataframe with len=0
- dataTypes => NaN in bool type columns are filled with True
- string type columns with decimal value with zero at the end still zero removed if there are no missing values in the column
Get limited amount of columns
- as_df = True => nice filter on duplicates
- as_df = False => doesn't filter on duplicates, which is fine I guess
…feat/pyclient-get-graphql
Quality Gate passedIssues Measures |
This has been fixed, but for ontology/ontology_array only as ontologies are only queried by their
This has been fixed. |
What are the main changes you did
This PR adds functionality to the Pyclients
get
method to be able to retrieve data through the GraphQL API.get
columns
parameter toget
, specifying which columns need to be returnedaddexpand
parameter to expand the query on reference columns to gather all columns from the referenced tableIn addition I added/fixed the following
get
method withas_df=True
(fix(Pyclient): ensure correct column types using schema metadata when processing data from CSV API #4502)How to test
Checklist