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

refactor: Make pl.duration non-anonymous #13762

Merged
merged 1 commit into from
Jan 17, 2024

Conversation

reswqa
Copy link
Collaborator

@reswqa reswqa commented Jan 16, 2024

This closes #13543.

@github-actions github-actions bot added internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars labels Jan 16, 2024
..Default::default()
},
}
.alias("duration")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

By convention (leftmost rule), we shouldn't give expression name(duration at this case). So I remove this alias.

@reswqa reswqa marked this pull request as ready for review January 16, 2024 09:35
@ritchie46
Copy link
Member

Not much non-anonymous left I think? 👀

@ritchie46 ritchie46 merged commit 0fbed85 into pola-rs:main Jan 17, 2024
22 checks passed
@reswqa
Copy link
Collaborator Author

reswqa commented Jan 17, 2024

@ritchie46 Yes, There are only very few left. I have checked, and it falls into two categories:

  1. Depending on user defined functions, for example: fold_expr/reduce_exprs/cum_reduce_exprs/cum_fold_exprs.
  2. It's not as simple as the other functions to get the output dtype. for example: list.to_struct/list.eval. list.to_struct assigns a rwLock first and then accesses this lock in GetOutput::map_dtype.
    let out_dtype = Arc::new(RwLock::new(None::<DataType>));

As for the first one, IIUC, UDF should not be able to non-anonymous 🤔. As for the second, do you have any thoughts?

@reswqa reswqa deleted the duration_hashable branch January 17, 2024 12:43
r-brink pushed a commit to r-brink/polars that referenced this pull request Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic when using duration with LazyFrame created from LazyCsvReader
2 participants