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

unable to call setDescription on RoutineInfo.Builder #3169

Open
hamnis opened this issue Feb 26, 2024 · 4 comments · May be fixed by #3170
Open

unable to call setDescription on RoutineInfo.Builder #3169

hamnis opened this issue Feb 26, 2024 · 4 comments · May be fixed by #3170
Labels
api: bigquery Issues related to the googleapis/java-bigquery API.

Comments

@hamnis
Copy link

hamnis commented Feb 26, 2024

Environment details

library version 2.38.0

Steps to reproduce

  1. try to setDescription on RoutineInfo.Builder
  2. fail compilation because package scope

Code example

RoutineInfo.of(ROUTINE_ID)
    .toBuilder()
    // .setDescription("some description") //fails to compile
    .setLanguage(LANGUAGE)
    .setArguments(ARGUMENT_LIST)
    .setReturnType(RETURN_TYPE)
    .setImportedLibraries(IMPORTED_LIBRARIES)
    .setBody(BODY)
    .build();
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/java-bigquery API. label Feb 26, 2024
@hamnis hamnis linked a pull request Feb 26, 2024 that will close this issue
4 tasks
@PhongChuong
Copy link
Contributor

Hi @hamnis ,
It is currently possible to use the builder to setDescription. Did you want to setDescription on RoutineInfo directly?

@hamnis
Copy link
Author

hamnis commented Mar 18, 2024

@PhongChuong it is not possible to use the builder since the builder.setDescription(String) is package protected, See the related PR.

@PhongChuong
Copy link
Contributor

Looking Routine more carefully. It seems like the description is coming from BigQuery backend. I'm hesitant in making setDescription public as it allows users to override the backend description value which makes debugging backend issues harder in the future. Is there a reason to override the description coming from BigQuery? Would it be possible to bundle another description value with RoutineInfo in your code outside of RoutineInfo?

Let me know what you think,

@hamnis
Copy link
Author

hamnis commented Mar 21, 2024

We are managing all the tables, views, materialized views, UDF and TFVs in our platform through our own scala library.
So we have built our own internal migration platform, meaning that all displayable properties in BQ should be possible to set in the scala library.

As a workaround for it not being public, we have added a class that exposes that in the com.google.cloud.bigquery package. I find it unfortunate that we have to do that.

https://github.com/nrkno/bigquery-scala/blob/main/google-client/src/main/scala/com/google/cloud/bigquery/RoutineInfoHelper.scala

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/java-bigquery API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants