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

Initial implementation of Data.read_many #11490

Merged
merged 23 commits into from
Nov 8, 2024
Merged

Conversation

radeusgd
Copy link
Member

@radeusgd radeusgd commented Nov 4, 2024

Pull Request Description

  • Part of Implement Data.read_many #11311
  • Adds ability to read a list of files (Vector, Column, Table) into a Vector.
  • Reading into a Table of objects or merged will come in a next PR.

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

Copy link
Member

@jdunkerley jdunkerley left a comment

Choose a reason for hiding this comment

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

Looks a great start to build on.

If `Auto_Detect` is specified; each file determines the specific
type and configures it appropriately. If there is no matching type then
a `File_Error.Unsupported_Type` error is returned.
- return: Specifies the shape of the data to return.
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure that I understand what a user would do with this option. Should it be on the graphical interface API?

Copy link
Member

Choose a reason for hiding this comment

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

OK. I get what this is now. Guess we will improve the comment as we add more options.

Copy link
Member Author

Choose a reason for hiding this comment

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

Happy to accept suggestions on what the doc could be. Perhaps I should add examples?

I hope in GUI it will be easy because we'll have a dropdown

Copy link
Member

@AdRiley AdRiley left a comment

Choose a reason for hiding this comment

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

Just a couple of small changes

@radeusgd radeusgd added CI: Ready to merge This PR is eligible for automatic merge CI: Clean build required CI runners will be cleaned before and after this PR is built. labels Nov 7, 2024
@mergify mergify bot merged commit e76fe90 into develop Nov 8, 2024
36 checks passed
@mergify mergify bot deleted the wip/radeusgd/11311-read-many branch November 8, 2024 19:03
to_display_text self -> Text = self.underlying.to_display_text

## PRIVATE
make_return self (input : Many_Files_List) (objects : Vector Any) =
Copy link
Member

Choose a reason for hiding this comment

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

Why isn't this method private?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is used from within Standard.Table.

Single_Choice display=Display.Always values=options

## PRIVATE
type Return_As_Base
Copy link
Member

Choose a reason for hiding this comment

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

Why isn't this type in its own private module?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because its constructors are actually supposed to be visible, only the type is hidden. Perhaps it can be moved to a separate module.

package org.enso.base.read;

@org.openide.util.lookup.ServiceProvider(service = ReadManyReturnSPI.class)
public class BaseReadManyReturnSPI extends ReadManyReturnSPI {
Copy link
Member

Choose a reason for hiding this comment

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

Repeating the terminology misuse - the BaeReadManyReturn class isn't interface, this class is implementation. I suggest to rename to BaseReadManyReturnImpl.

Make final.

Copy link
Member Author

Choose a reason for hiding this comment

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

All of our SPI implementations are named according to this convention.

If the convention is wrong, we should rename them all at once, which should be done separately from this PR.

import org.enso.base.polyglot.EnsoMeta;
import org.graalvm.polyglot.Value;

public abstract class ReadManyReturnSPI {
Copy link
Member

Choose a reason for hiding this comment

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

Missing documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: Clean build required CI runners will be cleaned before and after this PR is built. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants