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

Substrait serializer clippy error: not calling truncate #9727

Open
Tracked by #5173
alamb opened this issue Mar 21, 2024 · 1 comment
Open
Tracked by #5173

Substrait serializer clippy error: not calling truncate #9727

alamb opened this issue Mar 21, 2024 · 1 comment

Comments

@alamb
Copy link
Contributor

alamb commented Mar 21, 2024

As part of #9725 we had to disable a newly added clippy lint to get CI to pass

However it looks like the clippy lint is flagging a potential real issue

          @waynexia please check this

I suppressed the warning but clippy requires .truncate to be called before file creation

  --> datafusion/substrait/src/serializer.rs:32:39
   |
32 |     let mut file = OpenOptions::new().create(true).write(true).open(path)?;
   |                                       ^^^^^^^^^^^^- help: add: `.truncate(true)`
   |
   = help: if you intend to overwrite an existing file entirely, call `.truncate(true)`
   = help: if you instead know that you may want to keep some parts of the old file, call `.truncate(false)`
   = help: alternatively, use `.append(true)` to append to the file instead of overwriting it
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suspicious_open_options
   = note: `-D clippy::suspicious-open-options` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::suspicious_open_options)]`

Originally posted by @comphead in #9725 (comment)

@alamb
Copy link
Contributor Author

alamb commented Jun 9, 2024

I added to the substrait support epic: #5173

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

No branches or pull requests

1 participant