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

Mutate can rename columns #312

Merged
merged 3 commits into from
Aug 21, 2024
Merged

Mutate can rename columns #312

merged 3 commits into from
Aug 21, 2024

Conversation

srini047
Copy link
Contributor

@srini047 srini047 commented Aug 17, 2024

Fixes: #298
Docs: mutate() can rename columns with example

src/datachain/lib/dc.py Outdated Show resolved Hide resolved

Example:
```py
dc.mutate(
Copy link
Member

Choose a reason for hiding this comment

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

do we need a new string here? seems that it's small enough to fit the same line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I get more clarity on the same.

Copy link
Member

Choose a reason for hiding this comment

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

it's minor, not a blocker:

just to clarify - what I meant is to have

dc.mutate(newkey=Column("oldkey"))

(w/o extra newlines).

Again, not a blocker at all, just a suggestion to consider.

src/datachain/lib/dc.py Outdated Show resolved Hide resolved
src/datachain/lib/dc.py Outdated Show resolved Hide resolved
Copy link
Member

@shcheklein shcheklein left a comment

Choose a reason for hiding this comment

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

thanks for the PR @srini047 ! I left some comments in the ticket and in the PR.

Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.93%. Comparing base (35bef8a) to head (9078307).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #312   +/-   ##
=======================================
  Coverage   86.93%   86.93%           
=======================================
  Files          90       90           
  Lines        9899     9899           
  Branches     1996     1996           
=======================================
  Hits         8606     8606           
  Misses        944      944           
  Partials      349      349           
Flag Coverage Δ
datachain 86.86% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shcheklein
Copy link
Member

thanks @srini047 !

@shcheklein shcheklein merged commit 20b42d6 into iterative:main Aug 21, 2024
32 checks passed
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

Successfully merging this pull request may close these issues.

Document the column renaming capability of mutate()
2 participants