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

Implement the add_row_number function #6860

Closed
radeusgd opened this issue May 25, 2023 · 5 comments · Fixed by #6890
Closed

Implement the add_row_number function #6860

radeusgd opened this issue May 25, 2023 · 5 comments · Fixed by #6890
Assignees
Labels
-libs Libraries: New libraries to be implemented p-low Low priority x-new-feature Type: new feature request
Milestone

Comments

@radeusgd
Copy link
Member

radeusgd commented May 25, 2023

As noted in #6410, one of the tasks is to add a add_row_number function. I created this ticket for tracking this task.

Copying the specification from https://github.com/enso-org/design/blob/main/epics/basic-libraries/expressions/design.md#tableadd_row_number

Table.add_row_number

Adds the ability to add an index column to the table.

type Table

    ## Adds a new column to the table with the name `Row` and the values
       0 up to the number of records in the table.
    add_row_number : Text -> Integer -> Integer -> (Column_Selector | Vector Text) -> Sort_Column_Selector -> Problem_Behavior -> Table
    add_row_number self name="Row" from=1 increment=1 group_by=(By_Name []) order_by=(Sort_Column_Selector.By_Name []) on_problems=Problem_Behavior.Report_Warning  =
        ...
  • If the target name already exists in the Table, a Duplicate_Output_Column_Names will be raised.
    • The existing column will be renamed using the Unique_Name_Strategy.
    • The user can control the target name using the name argument.
  • By default, the record number will start at 1 and go up by 1.
    • This can be controlled using the from and increment arguments.
  • There is the ability to partition the record number using the group_by argument.
    • As with Column_Selector arguments, a Vector Text can be used and will be converted to a Column_Selector.By_Name.
  • Additionally, the order of results can be controlled using the order_by argument.
    • A Vector Text can be passed and will be converted to a Sort_Column_Selector.By_Name.
  • Within the database, (...) [not part of this ticket]
  • Note: Each row will be given a unique number within the group (regardless of any ties within the order by columns).
  • For the initial release, the column added will be an Integer column.
    • It is envisioned in a later version that the column type would be controllable by the user.
    • In this case, if a text-based type, then the user could make it fixed width with leading 0s.
@radeusgd radeusgd self-assigned this May 25, 2023
@radeusgd radeusgd moved this from ❓New to 🔧 Implementation in Issues Board May 25, 2023
@radeusgd radeusgd added -libs Libraries: New libraries to be implemented x-new-feature Type: new feature request p-low Low priority labels May 25, 2023
@enso-bot
Copy link

enso-bot bot commented May 29, 2023

Radosław Waśko reports a new STANDUP for the provided date (2023-05-26):

Progress: Some refactoring for the Mixed casts PR (split Table's NumericBuilder into LongBuilder and DoubleBuilder subclasses). Created initial tests for add_row_number It should be finished by 2023-05-31.

Next Day: Next day I will be working on the same task. Add some more test cases, work on implementation.

@enso-bot
Copy link

enso-bot bot commented May 30, 2023

Radosław Waśko reports a new STANDUP for yesterday (2023-05-29):

Progress: Added remaining tests. Implemented an in-Enso Multi_Value_Key and using it all the functionality. Need to fix some cases still. It should be finished by 2023-05-31.

Next Day: Next day I will be working on the same task. Fix the remaining cases, clarify some edge cases, prepare the PR.

@jdunkerley jdunkerley added this to the Beta Release milestone May 30, 2023
@radeusgd radeusgd moved this from 🔧 Implementation to 👁️ Code review in Issues Board May 30, 2023
@radeusgd radeusgd linked a pull request May 30, 2023 that will close this issue
5 tasks
@radeusgd
Copy link
Member Author

Apparently this is a duplicate of #5227 that I was not aware of.

@enso-bot
Copy link

enso-bot bot commented May 30, 2023

Radosław Waśko reports a new STANDUP for today (2023-05-30):

Progress: Fixing remaining cases. Bookclub. Do a refactor of Column_Index_Out_Of_Bounds Error. It should be finished by 2023-05-31.

Next Day: Next day I will be working on the #6498 task. Review suggestions on the add_row_number PR, start work on next task.

@enso-bot
Copy link

enso-bot bot commented Jun 1, 2023

Radosław Waśko reports a new STANDUP for yesterday (2023-05-31):

Progress: Refactor LongStorage into an AbstractLongStorage allowing O(1) storage of simple Range columns and preparing ground for columns-from-constants. Bookclub. Clarifying the spec on DB append. Starting to write the initial API and tests for DB append. It should be finished by 2023-05-31.

Next Day: Next day I will be working on the #6498 task. Add proper tests for DB append specification. Work on implementation.

@mergify mergify bot closed this as completed in #6890 Jun 2, 2023
@github-project-automation github-project-automation bot moved this from 👁️ Code review to 🟢 Accepted in Issues Board Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
-libs Libraries: New libraries to be implemented p-low Low priority x-new-feature Type: new feature request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants