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

toml_edit produces invalid TOML #594

Closed
messense opened this issue Aug 14, 2023 · 2 comments
Closed

toml_edit produces invalid TOML #594

messense opened this issue Aug 14, 2023 · 2 comments

Comments

@messense
Copy link

See the reproduction here: https://github.com/messense/toml-edit-repro, cargo run outputs

[dependencies]
polars-error = { version = "0.32.0", path = "../polars-error" }
atoi = { workspace = true, optional = true }

[dependencies.
arrow ]
package = "arrow2"
git = "https://github.com/jorgecarleitao/arrow2"
# git = "https://github.com/ritchie46/arrow2"
rev = "9beabec8cfb5502582d31ab898fdd36e7af0873c"
# path = "../arrow2"
# branch = "duration_json"
version = "0.17.2"
default-features = false
features = [
  "compute_aggregate",
  "compute_arithmetics",
  "compute_boolean",
  "compute_boolean_kleene",
  "compute_cast",
  "compute_comparison",
  "compute_concatenate",
  "compute_filter",
  "compute_if_then_else",
]

the

[dependencies.
arrow ]

part is invalid TOML.

See also:

@epage
Copy link
Member

epage commented Aug 14, 2023

This is a variant of #267 and I'd be tempted to close in favor of that and likely that is an issue we'll just be living with and not doing anything about.

The problem in this particular case is that we are providing a &mut and the user is overriding it. We cannot intercept this to change what is happening.

Our best option is to check every value on serialization and rewrite it behind the users back, leading to extra work and user confusion

Depending on where this is being done, a caller could just force-reformat the moved section or the entire toml.

@messense
Copy link
Author

Thanks for the quick reply!

I think I can workaround it by calling doc2_deps.remove("arrow") first, so feel free to close this issue.

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Aug 14, 2023
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

2 participants