Skip to content

Commit

Permalink
feat(rust,python,cli): additional SQL support for bytes, bit, and…
Browse files Browse the repository at this point in the history
… `hex` literals (pola-rs#13389)
  • Loading branch information
alexander-beedie authored Jan 4, 2024
1 parent a0c7f58 commit 22126da
Show file tree
Hide file tree
Showing 10 changed files with 327 additions and 204 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion crates/polars-core/src/datatypes/any_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,10 @@ impl<'a> AnyValue<'a> {
},
_ => return cast_numeric(self, dtype),
},
_ => polars_bail!(ComputeError: "cannot cast non numeric any-value to numeric dtype"),
AnyValue::String(s) if dtype == &DataType::Binary => AnyValue::Binary(s.as_bytes()),
_ => {
polars_bail!(ComputeError: "cannot cast any-value '{:?}' to '{:?}'", self.dtype(), dtype)
},
};
Ok(new_av)
}
Expand Down
166 changes: 83 additions & 83 deletions crates/polars-lazy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -200,107 +200,107 @@ test_all = [

[package.metadata.docs.rs]
features = [
"serde",
"abs",
"approx_unique",
"arg_where",
"asof_join",
"async",
"bigidx",
"binary_encoding",
"chunked_ids",
"cloud",
"temporal",
"streaming",
"cloud_write",
"coalesce",
"concat_str",
"cov",
"cross_join",
"chunked_ids",
"dtype-duration",
"dynamic_group_by",
"asof_join",
"nightly",
"cse",
"csv",
"cum_agg",
"cumulative_eval",
"cutqcut",
"date_offset",
"diagonal_concat",
"diff",
"dot_diagram",
"dtype-array",
"dtype-categorical",
"dtype-date",
"dtype-datetime",
"json",
"csv",
"async",
"ipc",
"parquet",
"round_series",
"is_in",
"dtype-i8",
"list_drop_nulls",
"fused",
"list_any_all",
"dtype-categorical",
"pivot",
"dtype-decimal",
"list_count",
"moment",
"list_sample",
"cutqcut",
"fmt",
"dtype-u16",
"list_sets",
"dtype-u8",
"dtype-duration",
"dtype-i16",
"rle",
"rolling_window",
"dtype-i8",
"dtype-struct",
"dtype-time",
"list_gather",
"diff",
"cov",
"search_sorted",
"date_offset",
"polars-time",
"tokio",
"trigonometry",
"is_last_distinct",
"dtype-u16",
"dtype-u8",
"dynamic_group_by",
"ewma",
"extract_groups",
"polars-pipe",
"peaks",
"random",
"top_k",
"approx_unique",
"concat_str",
"string_reverse",
"string_to_integer",
"cse",
"dot_diagram",
"panic_on_schema",
"regex",
"arg_where",
"fmt",
"fused",
"futures",
"hist",
"horizontal_concat",
"interpolate",
"ipc",
"is_first_distinct",
"string_pad",
"rank",
"is_in",
"is_last_distinct",
"is_unique",
"dtype-struct",
"timezones",
"json",
"list_any_all",
"list_count",
"list_drop_nulls",
"list_eval",
"list_gather",
"list_sample",
"list_sets",
"list_to_struct",
"log",
"merge_sorted",
"meta",
"mode",
"moment",
"nightly",
"object",
"panic_on_schema",
"parquet",
"pct_change",
"unique_counts",
"cum_agg",
"peaks",
"pivot",
"polars-json",
"polars-pipe",
"polars-time",
"propagate_nans",
"abs",
"sign",
"string_encoding",
"bigidx",
"row_hash",
"semi_anti_join",
"list_to_struct",
"random",
"range",
"ewma",
"log",
"rank",
"regex",
"repeat_by",
"cloud_write",
"polars-json",
"meta",
"coalesce",
"interpolate",
"true_div",
"strings",
"mode",
"binary_encoding",
"merge_sorted",
"cumulative_eval",
"list_eval",
"diagonal_concat",
"horizontal_concat",
"hist",
"replace",
"rle",
"rolling_window",
"round_series",
"row_hash",
"search_sorted",
"semi_anti_join",
"serde",
"sign",
"streaming",
"string_encoding",
"string_pad",
"string_reverse",
"string_to_integer",
"strings",
"temporal",
"timezones",
"tokio",
"top_k",
"trigonometry",
"true_div",
"unique_counts",
]
# defines the configuration attribute `docsrs`
rustdoc-args = ["--cfg", "docsrs"]
4 changes: 3 additions & 1 deletion crates/polars-sql/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ description = "SQL transpiler for Polars. Converts SQL to Polars logical plans"
arrow = { workspace = true }
polars-core = { workspace = true }
polars-error = { workspace = true }
polars-lazy = { workspace = true, features = ["strings", "cross_join", "trigonometry", "abs", "round_series", "log", "regex", "is_in", "meta", "cum_agg", "dtype-date"] }
polars-lazy = { workspace = true, features = ["abs", "binary_encoding", "cross_join", "cum_agg", "dtype-date", "is_in", "log", "meta", "regex", "round_series", "strings", "trigonometry"] }
polars-plan = { workspace = true }

hex = { workspace = true }
rand = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
Expand All @@ -29,4 +30,5 @@ ipc = ["polars-lazy/ipc"]
parquet = ["polars-lazy/parquet"]
semi_anti_join = ["polars-lazy/semi_anti_join"]
diagonal_concat = ["polars-lazy/diagonal_concat"]
binary_encoding = ["polars-lazy/binary_encoding"]
nightly = []
Loading

0 comments on commit 22126da

Please sign in to comment.