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

Add support for CREATE EXPERIMENT, expand support for WITH kwargs #796

Merged
merged 12 commits into from
Oct 7, 2022

Conversation

charlesbluca
Copy link
Collaborator

A continuation of @ChrisJar's work in #752; implements the basic plumbing for CREATE EXPERIMENT, and adds a PySqlArg struct to parser.rs that should allow us to parse nested kwargs in statements that use WITH.

Comment on lines 154 to 158
Value::Boolean(value) => Ok(if *value {
"1".to_string()
} else {
"".to_string()
}),
Copy link
Collaborator Author

@charlesbluca charlesbluca Sep 22, 2022

Choose a reason for hiding this comment

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

This is somewhat unclear mapping of booleans to strings is motivated by the fact that in Python, only empty strings are falsey (e.g. bool("False") == True); not sure if this serves as motivation to break up getSqlValue into several functions for the various different literal types.

@codecov-commenter
Copy link

codecov-commenter commented Sep 22, 2022

Codecov Report

Merging #796 (e1a060e) into main (4c6268d) will increase coverage by 2.29%.
The diff coverage is 90.00%.

@@            Coverage Diff             @@
##             main     #796      +/-   ##
==========================================
+ Coverage   74.88%   77.18%   +2.29%     
==========================================
  Files          71       71              
  Lines        3588     3594       +6     
  Branches      748      632     -116     
==========================================
+ Hits         2687     2774      +87     
+ Misses        771      687      -84     
- Partials      130      133       +3     
Impacted Files Coverage Δ
dask_sql/physical/rel/custom/create_experiment.py 96.25% <90.00%> (+82.50%) ⬆️
dask_sql/input_utils/hive.py 100.00% <0.00%> (ø)
dask_sql/context.py 94.16% <0.00%> (+0.83%) ⬆️
dask_sql/_version.py 34.00% <0.00%> (+1.44%) ⬆️
dask_sql/physical/rel/custom/create_model.py 91.52% <0.00%> (+6.77%) ⬆️
dask_sql/physical/rel/custom/show_models.py 80.00% <0.00%> (+26.66%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@charlesbluca
Copy link
Collaborator Author

gpuCI failures here are unrelated - working on a fix in #802

@charlesbluca charlesbluca marked this pull request as ready for review September 23, 2022 16:30

#[pyclass(name = "SqlArg", module = "datafusion")]
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PySqlArg {
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks like it should be an enum instead of a struct?

Copy link
Contributor

@andygrove andygrove left a comment

Choose a reason for hiding this comment

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

LGTM. It might be worth considering changing PySqlArg from a struct to an enum in the future, as this would simplify some of the pattern matching.

@ayushdg
Copy link
Collaborator

ayushdg commented Oct 7, 2022

rerun tests

Copy link
Collaborator

@ayushdg ayushdg left a comment

Choose a reason for hiding this comment

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

Changes generally lgtm! We can followup in another pr to simplify some structs as suggested by Andy and potentially consolidate of the pysqlArg methods

@charlesbluca charlesbluca deleted the create-experiment-1 branch March 19, 2024 16:31
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.

None yet

4 participants