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

Update register_table functions args to take Into<TableReference> #12630

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JasonLi-cn
Copy link
Contributor

Which issue does this PR close?

Closes #.

Rationale for this change

Changing &str into impl Into<TableReference> to be consistent with the register_table function.

Before:

    pub async fn register_listing_table(
        &self,
        name: &str,
        table_path: impl AsRef<str>,
        options: ListingOptions,
        provided_schema: Option<SchemaRef>,
        sql_definition: Option<String>,
    ) -> Result<()> {

After:

    pub async fn register_listing_table(
        &self,
        table_ref: impl Into<TableReference>,
        table_path: impl AsRef<str>,
        options: ListingOptions,
        provided_schema: Option<SchemaRef>,
        sql_definition: Option<String>,
    ) -> Result<()> {

What changes are included in this PR?

The modified functions include:

  • register_listing_table
  • register_avro
  • register_csv
  • register_json
  • register_parquet

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the core Core DataFusion crate label Sep 26, 2024
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @JasonLi-cn

I agree this is a nice API improvement for consistency and should cause minimal disruptuion during upgrades

I was hoping this PR would also fix #12607, but alas it did not

@alamb alamb changed the title modify register table functions args Update register_table functions args to take Into<TableReference> Sep 26, 2024
@alamb alamb added the api change Changes the API exposed to users of the crate label Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api change Changes the API exposed to users of the crate core Core DataFusion crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants