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

Allow sqldeserialize to return non-T to allow value/schema mismatch #267

Merged
merged 1 commit into from
Oct 23, 2021

Conversation

quinnj
Copy link
Member

@quinnj quinnj commented Oct 23, 2021

Fixes #244. Last time we refactored SQLite.Query, we took out any strict
schema enforcement, mainly by defining the Tales.schema of
SQLite.Query to be nothing, thus allowing sinks to "discover" the
schema dynamically, which better fits the sqlite data type model. As
reported in #244, however, we missed a case where we pass in the
declared column's type to sqlitevalue and then sqldeserialize was
being forced to assert that what it deserialized was a value of that
type. That isn't generally possible, since the declared sqlite types are
such a small subset of what we'll technically serialize/deserialize with
custom Julia values. By removing the type assertion, we allow
sqldeserialize to do its job and sqlitevalue to return whatever gets
deserialized.

Fixes #244. Last time we refactored SQLite.Query, we took out any strict
schema enforcement, mainly by defining the `Tales.schema` of
`SQLite.Query` to be `nothing`, thus allowing sinks to "discover" the
schema dynamically, which better fits the sqlite data type model. As
reported in #244, however, we missed a case where we pass in the
declared column's type to `sqlitevalue` and then `sqldeserialize` was
being forced to assert that what it deserialized was a value of that
type. That isn't generally possible, since the declared sqlite types are
such a small subset of what we'll technically serialize/deserialize with
custom Julia values. By removing the type assertion, we allow
sqldeserialize to do its job and sqlitevalue to return whatever gets
deserialized.
@codecov
Copy link

codecov bot commented Oct 23, 2021

Codecov Report

Merging #267 (c361a8d) into master (735d3fe) will increase coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #267      +/-   ##
==========================================
+ Coverage   85.27%   85.42%   +0.14%     
==========================================
  Files           5        5              
  Lines         686      686              
==========================================
+ Hits          585      586       +1     
+ Misses        101      100       -1     
Impacted Files Coverage Δ
src/SQLite.jl 96.35% <100.00%> (+0.40%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 735d3fe...c361a8d. Read the comment docs.

@quinnj quinnj merged commit 31465d1 into master Oct 23, 2021
@quinnj quinnj deleted the jq/244 branch October 23, 2021 06:36
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.

TypeError in select with missing values
1 participant