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

ColumnExpression first/last index #2585

Merged
merged 4 commits into from
Jan 15, 2025
Merged

Conversation

ADBond
Copy link
Contributor

@ADBond ADBond commented Jan 15, 2025

Type of PR

  • BUG
  • FEAT
  • MAINT
  • DOC

Is your Pull Request linked to an existing Issue or Pull Request?

Give a brief description for the solution you have provided

This provides some tooling for a dialect-agnostic way to select the first or last element of an array column, usable for instance in a blocking rule. So instead of

block_on("first_names_arr[1]", "last_names_arr[-1]")

in duckdb, which you would need to rewrite for other backends, you could have

block_on(
    ColumnExpression("first_names_arr").access_extreme_array_element("first"),
    ColumnExpression("last_names_arr").access_extreme_array_element("last"),
)

which will work for any backend.

PR Checklist

  • Added documentation for changes
  • Added feature to example notebooks or tutorial (if appropriate)
  • Added tests (if appropriate)
  • Updated CHANGELOG.md (if appropriate)
  • Made changes based off the latest version of Splink
  • Run the linter
  • Run the spellchecker (if appropriate)

@ADBond ADBond added the enhancement New feature or request label Jan 15, 2025
@ADBond ADBond requested a review from RobinL January 15, 2025 13:37
Copy link
Member

@RobinL RobinL left a comment

Choose a reason for hiding this comment

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

👍

@ADBond ADBond merged commit 24667bb into master Jan 15, 2025
30 checks passed
@ADBond ADBond deleted the feature/column-expression-first-index branch January 15, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants