-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix: Add strict parameter to rename_fields #19646
base: main
Are you sure you want to change the base?
Conversation
>>> s = s.struct.rename_fields(["c", "d"]) | ||
>>> s.struct.fields | ||
['c', 'd'] | ||
>>> s.struct.rename_fields(["c", "d"], strict=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reckon the example would be more informative if you:
- show the error you get if you try to rename but provide the wrong number of names with
strict=True
; - show what happens if you try to rename but provide the wrong number of names with
strict=False
; - both of the above
@@ -332,7 +336,7 @@ def with_fields( | |||
│ 1.0 ┆ 4 ┆ 40 ┆ 10 │ | |||
│ 2.0 ┆ 9 ┆ 18 ┆ 2 │ | |||
│ 3.0 ┆ 16 ┆ 48 ┆ 3 │ | |||
└─────┴─────┴───────┴──────────┘ | |||
└─────┴─────┴──���────┴───���──────┘ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funky formatting happening here 😬
@@ -214,7 +216,7 @@ def rename_fields(self, names: Sequence[str]) -> Expr: | |||
│ struct_col │ | |||
│ --- │ | |||
│ struct[4] │ | |||
╞══════════════════════╡ | |||
╞══════��═══════════════╡ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Funky formatting happening here 😬
closes #19132