-
Notifications
You must be signed in to change notification settings - Fork 67
refactor: suppress warnings #328
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,9 +39,9 @@ namespace iceberg::rest { | |
|
|
||
| /// \brief Server-provided configuration for the catalog. | ||
| struct ICEBERG_REST_EXPORT CatalogConfig { | ||
| std::unordered_map<std::string, std::string> defaults; // required | ||
| std::unordered_map<std::string, std::string> overrides; // required | ||
| std::vector<std::string> endpoints; | ||
| std::unordered_map<std::string, std::string> defaults{}; // required | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need to add |
||
| std::unordered_map<std::string, std::string> overrides{}; // required | ||
| std::vector<std::string> endpoints{}; | ||
|
|
||
| /// \brief Validates the CatalogConfig. | ||
| Status Validate() const { | ||
|
|
@@ -55,10 +55,10 @@ struct ICEBERG_REST_EXPORT CatalogConfig { | |
|
|
||
| /// \brief JSON error payload returned in a response with further details on the error. | ||
| struct ICEBERG_REST_EXPORT ErrorModel { | ||
| std::string message; // required | ||
| std::string type; // required | ||
| uint32_t code; // required | ||
| std::vector<std::string> stack; | ||
| std::string message{}; // required | ||
| std::string type{}; // required | ||
| uint32_t code{}; // required | ||
| std::vector<std::string> stack{}; | ||
|
|
||
| /// \brief Validates the ErrorModel. | ||
| Status Validate() const { | ||
|
|
@@ -77,7 +77,7 @@ struct ICEBERG_REST_EXPORT ErrorModel { | |
|
|
||
| /// \brief Error response body returned in a response. | ||
| struct ICEBERG_REST_EXPORT ErrorResponse { | ||
| ErrorModel error; // required | ||
| ErrorModel error{}; // required | ||
|
|
||
| /// \brief Validates the ErrorResponse. | ||
| // We don't validate the error field because ErrorModel::Validate has been called in the | ||
|
|
@@ -87,17 +87,17 @@ struct ICEBERG_REST_EXPORT ErrorResponse { | |
|
|
||
| /// \brief Request to create a namespace. | ||
| struct ICEBERG_REST_EXPORT CreateNamespaceRequest { | ||
| Namespace namespace_; // required | ||
| std::unordered_map<std::string, std::string> properties; | ||
| Namespace namespace_{}; // required | ||
| std::unordered_map<std::string, std::string> properties{}; | ||
|
|
||
| /// \brief Validates the CreateNamespaceRequest. | ||
| Status Validate() const { return {}; } | ||
| }; | ||
|
|
||
| /// \brief Update or delete namespace properties request. | ||
| struct ICEBERG_REST_EXPORT UpdateNamespacePropertiesRequest { | ||
| std::vector<std::string> removals; | ||
| std::unordered_map<std::string, std::string> updates; | ||
| std::vector<std::string> removals{}; | ||
| std::unordered_map<std::string, std::string> updates{}; | ||
|
|
||
| /// \brief Validates the UpdateNamespacePropertiesRequest. | ||
| Status Validate() const { | ||
|
|
@@ -112,8 +112,8 @@ struct ICEBERG_REST_EXPORT UpdateNamespacePropertiesRequest { | |
|
|
||
| /// \brief Request to register a table. | ||
| struct ICEBERG_REST_EXPORT RegisterTableRequest { | ||
| std::string name; // required | ||
| std::string metadata_location; // required | ||
| std::string name{}; // required | ||
| std::string metadata_location{}; // required | ||
| bool overwrite = false; | ||
|
|
||
| /// \brief Validates the RegisterTableRequest. | ||
|
|
@@ -132,8 +132,8 @@ struct ICEBERG_REST_EXPORT RegisterTableRequest { | |
|
|
||
| /// \brief Request to rename a table. | ||
| struct ICEBERG_REST_EXPORT RenameTableRequest { | ||
| TableIdentifier source; // required | ||
| TableIdentifier destination; // required | ||
| TableIdentifier source{}; // required | ||
| TableIdentifier destination{}; // required | ||
|
|
||
| /// \brief Validates the RenameTableRequest. | ||
| Status Validate() const { | ||
|
|
@@ -148,9 +148,9 @@ using PageToken = std::string; | |
|
|
||
| /// \brief Result body for table create/load/register APIs. | ||
| struct ICEBERG_REST_EXPORT LoadTableResult { | ||
| std::string metadata_location; | ||
| std::shared_ptr<TableMetadata> metadata; // required | ||
| std::unordered_map<std::string, std::string> config; | ||
| std::string metadata_location{}; | ||
| std::shared_ptr<TableMetadata> metadata{}; // required | ||
| std::unordered_map<std::string, std::string> config{}; | ||
| // TODO(Li Feiyang): Add std::shared_ptr<StorageCredential> storage_credential; | ||
|
|
||
| /// \brief Validates the LoadTableResult. | ||
|
|
@@ -170,45 +170,45 @@ using LoadTableResponse = LoadTableResult; | |
|
|
||
| /// \brief Response body for listing namespaces. | ||
| struct ICEBERG_REST_EXPORT ListNamespacesResponse { | ||
| PageToken next_page_token; | ||
| std::vector<Namespace> namespaces; | ||
| PageToken next_page_token{}; | ||
| std::vector<Namespace> namespaces{}; | ||
|
|
||
| /// \brief Validates the ListNamespacesResponse. | ||
| Status Validate() const { return {}; } | ||
| }; | ||
|
|
||
| /// \brief Response body after creating a namespace. | ||
| struct ICEBERG_REST_EXPORT CreateNamespaceResponse { | ||
| Namespace namespace_; // required | ||
| std::unordered_map<std::string, std::string> properties; | ||
| Namespace namespace_{}; // required | ||
| std::unordered_map<std::string, std::string> properties{}; | ||
|
|
||
| /// \brief Validates the CreateNamespaceResponse. | ||
| Status Validate() const { return {}; } | ||
| }; | ||
|
|
||
| /// \brief Response body for loading namespace properties. | ||
| struct ICEBERG_REST_EXPORT GetNamespaceResponse { | ||
| Namespace namespace_; // required | ||
| std::unordered_map<std::string, std::string> properties; | ||
| Namespace namespace_{}; // required | ||
| std::unordered_map<std::string, std::string> properties{}; | ||
|
|
||
| /// \brief Validates the GetNamespaceResponse. | ||
| Status Validate() const { return {}; } | ||
| }; | ||
|
|
||
| /// \brief Response body after updating namespace properties. | ||
| struct ICEBERG_REST_EXPORT UpdateNamespacePropertiesResponse { | ||
| std::vector<std::string> updated; // required | ||
| std::vector<std::string> removed; // required | ||
| std::vector<std::string> missing; | ||
| std::vector<std::string> updated{}; // required | ||
| std::vector<std::string> removed{}; // required | ||
| std::vector<std::string> missing{}; | ||
|
|
||
| /// \brief Validates the UpdateNamespacePropertiesResponse. | ||
| Status Validate() const { return {}; } | ||
| }; | ||
|
|
||
| /// \brief Response body for listing tables in a namespace. | ||
| struct ICEBERG_REST_EXPORT ListTablesResponse { | ||
| PageToken next_page_token; | ||
| std::vector<TableIdentifier> identifiers; | ||
| PageToken next_page_token{}; | ||
| std::vector<TableIdentifier> identifiers{}; | ||
|
|
||
| /// \brief Validates the ListTablesResponse. | ||
| Status Validate() const { return {}; } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -245,7 +245,7 @@ Result<Literal> LiteralCaster::CastFromBinary( | |
| switch (target_type->type_id()) { | ||
| case TypeId::kFixed: { | ||
| auto target_fixed_type = internal::checked_pointer_cast<FixedType>(target_type); | ||
| if (binary_val.size() == target_fixed_type->length()) { | ||
| if (static_cast<int32_t>(binary_val.size()) == target_fixed_type->length()) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In general, we should convert small types to large types. There are some similar codes in this PR that need to be modified. |
||
| return Literal::Fixed(std::move(binary_val)); | ||
| } | ||
| return InvalidArgument("Failed to cast Binary with length {} to Fixed({})", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can remove the parameters' names instead of adding
[[maybe_unused]]to keep the code clear.