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 filtering fields with null values from Raw #798

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

thorkildcognite
Copy link
Contributor

This exposes the query parameter to control whether Raw should return fields where the value is null or not. After several failed tries, it does this through the RawRows constructor, as this is also relevant for clients that do not filter the output (so it can't just be part of RawRowsFilter, sadly). The filter is simply not a query filter, like the other components of RawRowsFilter.

This exposes the query parameter to control whether Raw should return
fields where the value is null or not. After several failed tries, it
does this through the RawRows constructor, as this is also relevant
for clients that do not filter the output (so it can't just be part of
RawRowsFilter, sadly). The filter is simply not a query filter, like
the other components of RawRowsFilter.
Copy link
Contributor

@dmivankov dmivankov left a comment

Choose a reason for hiding this comment

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

Unsure if it's better to put parameter on resource client or on each call, but that'd be ok to change later
Always passing the parameter to url sounds ok too, so sdk isn't relying on possibly changing service defaults

@dmivankov
Copy link
Contributor

some lint warnings in scala3 build

@thorkildcognite
Copy link
Contributor Author

Unsure if it's better to put parameter on resource client or on each call, but that'd be ok to change later Always passing the parameter to url sounds ok too, so sdk isn't relying on possibly changing service defaults

It got fugly, since the logic to handle resource client setup is reused across databases, tables and rows, and this is only applicable for rows.

So after trying to make it pretty, I broke down and added it to the constructor and then to the baseUrl (the latter we did already with filters). I first put it into the RawRowFilter, but that didn't work for the list() call.

@dmivankov dmivankov merged commit 1fff71f into master Nov 12, 2024
6 checks passed
@dmivankov dmivankov deleted the expose-json-filtering branch November 12, 2024 08:04
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.66%. Comparing base (11ff1b4) to head (e01a380).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #798      +/-   ##
==========================================
+ Coverage   84.63%   84.66%   +0.02%     
==========================================
  Files          96       96              
  Lines        2682     2687       +5     
  Branches      238      235       -3     
==========================================
+ Hits         2270     2275       +5     
  Misses        412      412              
Files with missing lines Coverage Δ
...c/main/scala/com/cognite/sdk/scala/v1/Client.scala 82.92% <100.00%> (ø)
...scala/com/cognite/sdk/scala/v1/resources/raw.scala 98.76% <100.00%> (+0.08%) ⬆️

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