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

Removes PartiQLValue from public API #1678

Merged
merged 4 commits into from
Dec 27, 2024

Conversation

johnedquinn
Copy link
Member

@johnedquinn johnedquinn commented Dec 11, 2024

Description

This PR can be broken up into TWO main commits: the removal of PartiQLValue and the true onboarding of VARIANT as a first-class type. I couldn't merge just the first commit, since the conformance tests failed an additional 1000+ tests. So, the second one naturally followed.

Removal of PartiQLValue (1st commit)

  • This PR removes PartiQLValue from the public API. It also removes the public conversions between PartiQLValue, Datum, PartiQLValueType, and PType.
  • It does this by moving its definition (and other relevant classes such as impls and conversions) into testFixtures.
    • Test sources will temporarily rely on PartiQLValue, until it is fully deleted in the future.
    • The only main source set relying on the testFixtures is partiql-cli
  • I also updated the internal Sprout model to use Datum instead of PartiQLValue.
  • This also removes PartiQLValueExperimental

Support for VARIANT (2nd commit)

  • VARIANT needed to be supported due to the lack of parity between the PartiQLValueReader and the IonDatumReader -- which is for decoding PartiQL values that are encoded in Ion. Rather than what VARIANT is, which is decoding arbitrary Ion data into PartiQL structures.
  • So, this PR was born. This essentially just uses lower() whenever we find a variant value at runtime. It also adds the static type checking required for variant.

Reviewer's Notices

  • I'd look at the two commits individually so that it is easier to understand why something is changing. They're both relatively straightforward.
  • We now pass additional conformance tests 🎊 without failing any previous ones, bringing us from 54 failing tests to 47.

License Information

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@johnedquinn johnedquinn force-pushed the main-remove-partiql-value branch from c04cc9d to 6f526aa Compare December 11, 2024 15:32
@johnedquinn johnedquinn marked this pull request as ready for review December 11, 2024 16:10
@johnedquinn johnedquinn marked this pull request as draft December 11, 2024 16:13
Removes PartiQLValueType from public API

Removes PartiQLValueExperimental from public API

Removes PartiQLValue reader/writer from public API

Moves public and internal APIs to textFixtures until testing can be fully migrated
Fixes conformance tests related to the lack of a VARIANT type.
@johnedquinn johnedquinn force-pushed the main-remove-partiql-value branch from 9f97db1 to f70aa7a Compare December 13, 2024 23:51
@johnedquinn johnedquinn requested a review from RCHowell December 13, 2024 23:58
@johnedquinn johnedquinn marked this pull request as ready for review December 13, 2024 23:58
Adds PType static factory methods with default parameters

Renames factory methods for creating Datum and PartiQLValue

Adds AST-to-Plan typing logic of integers to the Ion Variant

Reverts the IonDatumReader changes to focus on limited scope

Adds a lowerSafe() internal utility method for reducing code size

Updates some Javadocs & comments
Updates Accumulator to check for variant on number types

Updates internal docs for clarification

Simplifies IonVariant conversion for BigIntegers
@codecov-commenter
Copy link

codecov-commenter commented Dec 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.03%. Comparing base (d059c81) to head (5a9b63d).
Report is 444 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1678      +/-   ##
============================================
+ Coverage     73.16%   80.03%   +6.87%     
+ Complexity     2393       47    -2346     
============================================
  Files           247       19     -228     
  Lines         17627      506   -17121     
  Branches       3178       23    -3155     
============================================
- Hits          12896      405   -12491     
+ Misses         3854       88    -3766     
+ Partials        877       13     -864     
Flag Coverage Δ
CLI ?
EXAMPLES 80.03% <ø> (-0.04%) ⬇️
LANG ?

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@johnedquinn johnedquinn dismissed RCHowell’s stale review December 27, 2024 21:03

Received approval outside of GitHub. He is OOO.

@johnedquinn johnedquinn merged commit 1abe677 into partiql:main Dec 27, 2024
7 checks passed
@johnedquinn johnedquinn deleted the main-remove-partiql-value branch December 27, 2024 21:04
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.

5 participants