Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1140,6 +1140,10 @@ class YarnApplication(proto.Message):
application-specific information. The URL uses
the internal hostname, and requires a proxy
server for resolution and, possibly, access.
vcore_seconds (int):
Optional. The cumulative CPU time consumed by the application for a job, measured in vcore-seconds.
memory_mb_seconds (int):
Optional. The cumulative memory usage of the application for a job, measured in mb-seconds.
Comment on lines +1143 to +1146
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The docstring for these fields should be updated for consistency and accuracy. Specifically:

  1. The "Optional." prefix is not standard for message fields in this library and should be removed, as these fields are not marked as optional in the official Dataproc proto.
  2. The unit for memory_mb_seconds should be "megabyte-seconds" to match the official documentation and provide better clarity than "mb-seconds".
  3. Note that the progress field (field 4) appears to be missing from the docstring between tracking_url and vcore_seconds.
Suggested change
vcore_seconds (int):
Optional. The cumulative CPU time consumed by the application for a job, measured in vcore-seconds.
memory_mb_seconds (int):
Optional. The cumulative memory usage of the application for a job, measured in mb-seconds.
vcore_seconds (int):
The cumulative CPU time consumed by the application for a job, measured in vcore-seconds.
memory_mb_seconds (int):
The cumulative memory usage of the application for a job, measured in megabyte-seconds.

"""

class State(proto.Enum):
Expand Down Expand Up @@ -1194,6 +1198,16 @@ class State(proto.Enum):
proto.STRING,
number=4,
)
vcore_seconds: int = proto.Field(
proto.INT64,
number=5,
optional=True,
)
memory_mb_seconds: int = proto.Field(
proto.INT64,
number=6,
optional=True,
)
Comment on lines +1201 to +1210
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The optional=True parameter should be removed. According to the official Dataproc V1 YarnApplication proto definition, these fields are standard int64 fields and do not use the optional keyword. Adding optional=True in proto-plus enables explicit presence tracking, which is inconsistent with the existing fields in this message (like field 4) and the backend proto definition.

    vcore_seconds: int = proto.Field(
        proto.INT64,
        number=5,
    )
    memory_mb_seconds: int = proto.Field(
        proto.INT64,
        number=6,
    )



class Job(proto.Message):
Expand Down
Loading