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

Generate library for google/cloud/bigquery/v2 (admin) #829

Open
2 of 3 tasks
Tracked by #745
coryan opened this issue Jan 24, 2025 · 0 comments · May be fixed by #1540
Open
2 of 3 tasks
Tracked by #745

Generate library for google/cloud/bigquery/v2 (admin) #829

coryan opened this issue Jan 24, 2025 · 0 comments · May be fixed by #1540
Labels
api: bigquery Issues related to the BigQuery API. external This issue is blocked on a bug with the actual product. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@coryan
Copy link
Contributor

coryan commented Jan 24, 2025

Blocked by:


Generate

cargo new --lib --vcs none src/generated/cloud/bigquery/v2
taplo fmt Cargo.toml
go -C generator/ run ./cmd/sidekick generate     -project-root ..     -specification-source google/cloud/bigquery/v2     -service-config google/cloud/bigquery/v2/bigquery_v2.yaml -output src/generated/cloud/bigquery/v2
cargo fmt

The build fails.

A number of duplicate enum values:

error[E0428]: the name `MINIMAL` is defined multiple times
    --> src/generated/cloud/bigquery/v2/src/model.rs:3925:9
     |
3922 |         pub const MINIMAL: &str = "minimal";
     |         ------------------------------------ previous definition of the value `MINIMAL` here
...
3925 |         pub const MINIMAL: &str = "MINIMAL";
     |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `MINIMAL` redefined here
     |
     = note: `MINIMAL` must be defined only once in the value namespace of this module

Another kind of cycle making infinitely-sized structs

error[E0072]: recursive types `StandardSqlDataType` and `SubType` have infinite size
     --> src/generated/cloud/bigquery/v2/src/model.rs:20289:1
      |
20289 | pub struct StandardSqlDataType {
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
20296 |     pub sub_type: std::option::Option<crate::model::standard_sql_data_type::SubType>,
      |                                       --------------------------------------------- recursive without indirection
...
20414 |     pub enum SubType {
      |     ^^^^^^^^^^^^^^^^
20415 |         /// The type of the array's elements, if type_kind = "ARRAY".
20416 |         ArrayElementType(crate::model::StandardSqlDataType),
      |                          --------------------------------- recursive without indirection
      |
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to break the cycle
      |
20296 ~     pub sub_type: std::option::Option<Box<crate::model::standard_sql_data_type::SubType>>,
20297 | }
...
20415 |         /// The type of the array's elements, if type_kind = "ARRAY".
20416 ~         ArrayElementType(Box<crate::model::StandardSqlDataType>),
      |

We may have problems with wkt::*Value and repeated fields:

error[E0308]: `?` operator has incompatible types
     --> src/generated/cloud/bigquery/v2/src/model.rs:16094:9
      |
16094 |         #[serde_with::serde_as]
      |         ^^^^^^^^^^^^^^^^^^^^^^^ expected `Vec<i64>`, found `Option<_>`
      |
      = note: `?` operator cannot convert from `std::option::Option<_>` to `Vec<i64>`
 #[serde_with::serde_as]
        #[derive(Clone, Debug, Default, PartialEq, serde::Deserialize, serde::Serialize)]
        #[serde(default, rename_all = "camelCase")]
        #[non_exhaustive]
        pub struct IntCandidates {
            /// Candidates for the int parameter in increasing order.
            #[serde(skip_serializing_if = "std::vec::Vec::is_empty")]
            #[serde_as(as = "std::option::Option<serde_with::DisplayFromStr>")]
            pub candidates: std::vec::Vec<wkt::Int64Value>,
        }

Lots of typos

# src/generated/cloud/bigquery/v2 has some typos, they need to be fixed upstream.
ALS           = "ALS"
Ded           = "Ded"
cachable      = "cachable"
classfication = "classfication"
exeeds        = "exeeds"
logorithmic   = "logorithmic"
maped         = "maped"
preemptable   = "preemptable"
specifices    = "specifices"
formate       = "formate"
Nam           = "Nam"           # For Viet Nam
@coryan coryan added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. api: bigquery Issues related to the BigQuery API. labels Jan 24, 2025
@coryan coryan added the external This issue is blocked on a bug with the actual product. label Feb 17, 2025
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 BigQuery API. external This issue is blocked on a bug with the actual product. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant