Skip to content

Fix broken serde feature - #15124

Merged
alamb merged 5 commits into
apache:mainfrom
vadimpiven:main
Mar 11, 2025
Merged

Fix broken serde feature#15124
alamb merged 5 commits into
apache:mainfrom
vadimpiven:main

Conversation

@vadimpiven

@vadimpivenvadimpiven commented Mar 10, 2025

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

PR #14597 have removed the line

serde = ["arrow-schema/serde"]

which broke serde feature. Reverting this change.

What changes are included in this PR?

serde feature update

Are these changes tested?

Added test and pipeline invocation.

Are there any user-facing changes?

No user-facing changes.

@github-actionsgithub-actionsBot added the core Core DataFusion crate label Mar 10, 2025
@Weijun-H

Copy link
Copy Markdown
Member

I am surprised that CI did not notice it. Could we add a test for that?

Comment threaddatafusion/core/Cargo.toml Outdated
"datafusion-sql/recursive_protection",
]
serde = ["dep:serde"]
serde = ["dep:serde", "arrow-schema/serde"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it would be great to comment why serde needed here

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Added comment, if it's not what you proposed, please tell what I should write in there)

@alambalamb changed the title Fix broked serde featureFix broken serde featureMar 10, 2025
@github-actionsgithub-actionsBot added the development-process Related to development process of DataFusion label Mar 10, 2025
@vadimpiven

Copy link
Copy Markdown
ContributorAuthor

@Weijun-H added test, please check that it is in the correct place. Also I was not sure if I should make a separate pipeline invocation, please let me know if I should

@vadimpiven

vadimpiven commented Mar 11, 2025

Copy link
Copy Markdown
ContributorAuthor

Test failed because of “no space left on device” error from runner. Can someone please restart it?

@vadimpiven

Copy link
Copy Markdown
ContributorAuthor

Merged main to trigger CI

Comment thread.github/workflows/rust.yml Outdated
rust-version: stable
- name: Run tests (excluding doctests)
run: cargo test --profile ci --exclude datafusion-examples --exclude ffi_example_table_provider --exclude datafusion-benchmarks --workspace --lib --tests --bins --features avro,json,backtrace,integration-tests
- name: Run serde feature test

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think we need to run the tests -- we just need to check that the code compiles

Perhaps we can add the check here:

- name: Check datafusion (nested_expressions)
run: cargo check --profile ci --no-default-features --features=nested_expressions -p datafusion

And adjust the comments to say it works with a subset

# cargo check datafusion to ensure that the datafusion crate can be built with only a# subset of the function packages enabled.
# cargo check datafusion to ensure that the datafusion crate can be built with only a# subset of the packages enabled.

I'll make this change and push to your branch to save some more back and forth cycles

@alambalamb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you @vadimpiven

I pushed a commit to move the test into an existing test binary and run it as part of the CI tests

// specific language governing permissions and limitations
// under the License.

/// Ensure `serde` feature from `arrow-schema` crate is re-exported.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I consolidated this into the core_integration binary so we didn't have to build a new target to test this

andrewlamb@Andrews-MacBook-Pro-2:~/Software/datafusion$ cargo test --test core_integration --features=serde -- serde
Compiling datafusion v46.0.0 (/Users/andrewlamb/Software/datafusion/datafusion/core)
Finished `test` profile [unoptimized + debuginfo] target(s) in 8.36s
Running tests/core_integration.rs (target/debug/deps/core_integration-acc990c95fa5aa49)
running 1 test
test serde::ensure_serde_support ... ok
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 567 filtered out; finished in 0.00s
andrewlamb@Andrews-MacBook-Pro-2:~/Software/datafusion$ cargo test --test core_integration -- serde
Compiling datafusion v46.0.0 (/Users/andrewlamb/Software/datafusion/datafusion/core)
Finished `test` profile [unoptimized + debuginfo] target(s) in 2.68s
Running tests/core_integration.rs (target/debug/deps/core_integration-370a90f8f594db8d)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 567 filtered out; finished in 0.00s

mod physical_optimizer;

/// Run all tests that are found in the `serde` directory
mod serde;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

moved the test here

@alamb
alamb merged commit f31ddd6 into apache:mainMar 11, 2025
@alamb

Copy link
Copy Markdown
Contributor

Thanks again @vadimpiven and @Weijun-H

alamb added a commit to alamb/datafusion that referenced this pull request Mar 14, 2025
* Fix broked `serde` feature
* Test `serde` feature
* consolidate serde test into core_integration, update run
---------
Co-authored-by: Andrew Lamb <andrew@nerdnetworks.org>
@alamb

Copy link
Copy Markdown
Contributor

alamb added a commit that referenced this pull request Mar 14, 2025
* Fix broked `serde` feature
* Test `serde` feature
* consolidate serde test into core_integration, update run
---------
Co-authored-by: Vadim Piven <vadim@piven.tech>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coreCore DataFusion cratedevelopment-processRelated to development process of DataFusion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Serde feature is broken

4 participants

@vadimpiven@Weijun-H@alamb@comphead