Skip to content

Fix broken serde feature #15124

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

Merged
merged 5 commits into from
Mar 11, 2025
Merged

Fix broken serde feature #15124

merged 5 commits into from
Mar 11, 2025

Conversation

vadimpiven
Copy link
Contributor

@vadimpiven vadimpiven commented Mar 10, 2025

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-actions github-actions bot added the core Core DataFusion crate label Mar 10, 2025
@Weijun-H
Copy link
Member

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

@@ -79,7 +79,7 @@ recursive_protection = [
"datafusion-physical-optimizer/recursive_protection",
"datafusion-sql/recursive_protection",
]
serde = ["dep:serde"]
serde = ["dep:serde", "arrow-schema/serde"]
Copy link
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
Contributor Author

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)

@alamb alamb changed the title Fix broked serde feature Fix broken serde feature Mar 10, 2025
@github-actions github-actions bot added the development-process Related to development process of DataFusion label Mar 10, 2025
@vadimpiven
Copy link
Contributor Author

@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
Copy link
Contributor Author

vadimpiven commented Mar 11, 2025

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

@vadimpiven
Copy link
Contributor Author

Merged main to trigger CI

@@ -184,6 +184,8 @@ jobs:
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
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

Copy link
Contributor

@alamb alamb left a comment

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
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
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:main Mar 11, 2025
26 checks passed
@alamb
Copy link
Contributor

alamb commented Mar 11, 2025

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
Contributor

alamb commented Mar 14, 2025

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 free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Core DataFusion crate development-process Related to development process of DataFusion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Serde feature is broken
4 participants