This repository was archived by the owner on Mar 26, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 80
This repository was archived by the owner on Mar 26, 2026. It is now read-only.
Add support for field with name self #2206
Copy link
Copy link
Closed
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
See message DataSourceReference in google/shopping/merchant/datasources/v1beta/datasourcetypes.proto which has field with name self.
Having a field with the name self is not supported as self is the first argument to instance methods as mentioned in PEP8 here: Always use self for the first argument to instance methods.
From google/shopping/merchant/datasources/v1beta/datasourcetypes.proto,
// Data source reference can be used to manage related data sources within the
// data source service.
message DataSourceReference {
oneof data_source_id {
// Self should be used to reference the primary data source itself.
bool self = 1;
// Optional. The name of the primary data source.
// Format:
// `accounts/{account}/dataSources/{datasource}`
string primary_data_source_name = 3
[(google.api.field_behavior) = OPTIONAL];
// Optional. The name of the supplemental data source.
// Format:
// `accounts/{account}/dataSources/{datasource}`
string supplemental_data_source_name = 2
[(google.api.field_behavior) = OPTIONAL];
}
}
See build log here where generated tests fail with error E TypeError: Message.__init__() got multiple values for argument 'self'
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.