Skip to content

Commit da5b29c

Browse files
c
1 parent b32a261 commit da5b29c

File tree

36 files changed

+971
-93
lines changed

36 files changed

+971
-93
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ requirements: .venv ## Install/refresh Python project requirements
7878
-r py-polars/requirements-lint.txt \
7979
-r py-polars/docs/requirements-docs.txt \
8080
-r docs/source/requirements.txt \
81-
&& $(VENV_BIN)/uv pip install --upgrade --compile-bytecode "pyiceberg>=0.7.1"
81+
&& $(VENV_BIN)/uv pip install --upgrade --compile-bytecode "pyiceberg>=0.7.1" pyiceberg-core
8282

8383
.PHONY: requirements-all
8484
requirements-all: .venv ## Install/refresh all Python requirements (including those needed for CI tests)

crates/polars-core/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub fn verbose_print_sensitive<F: Fn() -> String>(create_log_message: F) {
4242
fn do_log(create_log_message: &dyn Fn() -> String) {
4343
if std::env::var("POLARS_VERBOSE_SENSITIVE").as_deref() == Ok("1") {
4444
// Force the message to be a single line.
45-
let msg = create_log_message().replace('\n', "");
45+
let msg = create_log_message().replace('\n', " ");
4646
eprintln!("[SENSITIVE]: {msg}")
4747
}
4848
}

crates/polars-core/src/frame/column/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ mod series;
3939
/// 2. A [`ScalarColumn`] that repeats a single [`Scalar`]
4040
#[derive(Debug, Clone)]
4141
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
42+
#[cfg_attr(feature = "dsl-schema", derive(schemars::JsonSchema))]
4243
pub enum Column {
4344
Series(SeriesColumn),
4445
Partitioned(PartitionedColumn),

crates/polars-core/src/frame/column/partitioned.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,14 @@ use crate::series::IsSorted;
1313

1414
#[derive(Debug, Clone)]
1515
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
16+
#[cfg_attr(feature = "dsl-schema", derive(schemars::JsonSchema))]
1617
pub struct PartitionedColumn {
1718
name: PlSmallStr,
1819

1920
values: Series,
2021
ends: Arc<[IdxSize]>,
2122

22-
#[cfg_attr(feature = "serde", serde(skip))]
23+
#[cfg_attr(feature = "serde", serde(skip, default))]
2324
materialized: OnceLock<Series>,
2425
}
2526

crates/polars-core/src/frame/column/scalar.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,21 @@ impl From<ScalarColumn> for Column {
326326
}
327327
}
328328

329+
#[cfg(feature = "dsl-schema")]
330+
impl schemars::JsonSchema for ScalarColumn {
331+
fn schema_name() -> String {
332+
"ScalarColumn".to_owned()
333+
}
334+
335+
fn schema_id() -> std::borrow::Cow<'static, str> {
336+
std::borrow::Cow::Borrowed(concat!(module_path!(), "::", "ScalarColumn"))
337+
}
338+
339+
fn json_schema(generator: &mut schemars::r#gen::SchemaGenerator) -> schemars::schema::Schema {
340+
serde_impl::SerializeWrap::json_schema(generator)
341+
}
342+
}
343+
329344
#[cfg(feature = "serde")]
330345
mod serde_impl {
331346
use std::sync::OnceLock;
@@ -337,7 +352,8 @@ mod serde_impl {
337352
use crate::frame::{Scalar, Series};
338353

339354
#[derive(serde::Serialize, serde::Deserialize)]
340-
struct SerializeWrap {
355+
#[cfg_attr(feature = "dsl-schema", derive(schemars::JsonSchema))]
356+
pub struct SerializeWrap {
341357
name: PlSmallStr,
342358
/// Unit-length series for dispatching to IPC serialize
343359
unit_series: Series,

crates/polars-core/src/frame/column/series.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ use super::Series;
88
/// problems can be tracked down.
99
#[derive(Debug, Clone)]
1010
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
11+
#[cfg_attr(feature = "dsl-schema", derive(schemars::JsonSchema))]
1112
pub struct SeriesColumn {
1213
inner: Series,
1314

1415
#[cfg(debug_assertions)]
15-
#[cfg_attr(feature = "serde", serde(skip))]
16+
#[cfg_attr(feature = "serde", serde(skip, default))]
1617
materialized_at: Option<std::sync::Arc<std::backtrace::Backtrace>>,
1718
}
1819

crates/polars-lazy/src/scan/anonymous_scan.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ impl LazyFrame {
5050
cache: false,
5151
glob: false,
5252
projection: None,
53+
column_mapping: None,
54+
default_values: None,
5355
row_index: None,
5456
pre_slice: args.n_rows.map(|len| Slice::Positive { offset: 0, len }),
5557
cast_columns_policy: CastColumnsPolicy::ERROR_ON_MISMATCH,
5658
missing_columns_policy: MissingColumnsPolicy::Raise,
5759
extra_columns_policy: ExtraColumnsPolicy::Raise,
5860
include_file_paths: None,
59-
column_mapping: None,
61+
6062
deletion_files: None,
6163
},
6264
)?

crates/polars-lazy/src/scan/csv.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,14 @@ impl LazyFileListReader for LazyCsvReader {
338338
cache: self.cache,
339339
glob: self.glob,
340340
projection: None,
341+
column_mapping: None,
342+
default_values: None,
341343
row_index,
342344
pre_slice,
343345
cast_columns_policy: CastColumnsPolicy::ERROR_ON_MISMATCH,
344346
missing_columns_policy: MissingColumnsPolicy::Raise,
345347
extra_columns_policy: ExtraColumnsPolicy::Raise,
346348
include_file_paths: self.include_file_paths,
347-
column_mapping: None,
348349
deletion_files: None,
349350
},
350351
)?

crates/polars-lazy/src/scan/ipc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,14 @@ impl LazyFileListReader for LazyIpcReader {
7272
cache,
7373
glob: true,
7474
projection: None,
75+
column_mapping: None,
76+
default_values: None,
7577
row_index,
7678
pre_slice,
7779
cast_columns_policy: CastColumnsPolicy::ERROR_ON_MISMATCH,
7880
missing_columns_policy: MissingColumnsPolicy::Raise,
7981
extra_columns_policy: ExtraColumnsPolicy::Raise,
8082
include_file_paths,
81-
column_mapping: None,
8283
deletion_files: None,
8384
},
8485
)?

crates/polars-lazy/src/scan/ndjson.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,14 @@ impl LazyFileListReader for LazyJsonLineReader {
133133
cache: false,
134134
glob: true,
135135
projection: None,
136+
column_mapping: None,
137+
default_values: None,
136138
row_index: self.row_index,
137139
pre_slice: self.n_rows.map(|len| Slice::Positive { offset: 0, len }),
138140
cast_columns_policy: CastColumnsPolicy::ERROR_ON_MISMATCH,
139141
missing_columns_policy: MissingColumnsPolicy::Raise,
140142
extra_columns_policy: ExtraColumnsPolicy::Raise,
141143
include_file_paths: self.include_file_paths,
142-
column_mapping: None,
143144
deletion_files: None,
144145
};
145146

0 commit comments

Comments
 (0)