Skip to content

Commit

Permalink
feat: [google-cloud-dataproc] add support for Spark Connect sessions …
Browse files Browse the repository at this point in the history
…in Dataproc Serverless for Spark (#13106)

BEGIN_COMMIT_OVERRIDE
feat: add support for Spark Connect sessions in Dataproc Serverless for
Spark
docs: update docs for `filter` field in `ListSessionsRequest`
END_COMMIT_OVERRIDE

- [ ] Regenerate this pull request now.

docs: update docs for `filter` field in `ListSessionsRequest`

PiperOrigin-RevId: 678438691

Source-Link:
googleapis/googleapis@5c181aa

Source-Link:
googleapis/googleapis-gen@3b37678
Copy-Tag:
eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRhdGFwcm9jLy5Pd2xCb3QueWFtbCIsImgiOiIzYjM3Njc4ZTNlZDRlNTJmMmExMjJlYTkxNzM4YTllN2I1ZjRjYmExIn0=

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Sep 30, 2024
1 parent c638f1f commit 0d35003
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@
ListSessionsRequest,
ListSessionsResponse,
Session,
SparkConnectConfig,
TerminateSessionRequest,
)
from google.cloud.dataproc_v1.types.shared import (
Expand Down Expand Up @@ -362,6 +363,7 @@
"ListSessionsRequest",
"ListSessionsResponse",
"Session",
"SparkConnectConfig",
"TerminateSessionRequest",
"AutotuningConfig",
"EnvironmentConfig",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "5.12.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@
ListSessionsRequest,
ListSessionsResponse,
Session,
SparkConnectConfig,
TerminateSessionRequest,
)
from .types.shared import (
Expand Down Expand Up @@ -353,6 +354,7 @@
"ShieldedInstanceConfig",
"SoftwareConfig",
"SparkBatch",
"SparkConnectConfig",
"SparkHistoryServerConfig",
"SparkJob",
"SparkRBatch",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
__version__ = "5.12.0" # {x-release-please-version}
__version__ = "0.0.0" # {x-release-please-version}
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
ListSessionsRequest,
ListSessionsResponse,
Session,
SparkConnectConfig,
TerminateSessionRequest,
)
from .shared import (
Expand Down Expand Up @@ -295,6 +296,7 @@
"ListSessionsRequest",
"ListSessionsResponse",
"Session",
"SparkConnectConfig",
"TerminateSessionRequest",
"AutotuningConfig",
"EnvironmentConfig",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@ class DeleteSessionTemplateRequest(proto.Message):
class SessionTemplate(proto.Message):
r"""A representation of a session template.
This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
Expand All @@ -189,6 +194,10 @@ class SessionTemplate(proto.Message):
jupyter_session (google.cloud.dataproc_v1.types.JupyterConfig):
Optional. Jupyter session config.
This field is a member of `oneof`_ ``session_config``.
spark_connect_session (google.cloud.dataproc_v1.types.SparkConnectConfig):
Optional. Spark Connect session config.
This field is a member of `oneof`_ ``session_config``.
creator (str):
Output only. The email address of the user
Expand Down Expand Up @@ -236,6 +245,12 @@ class SessionTemplate(proto.Message):
oneof="session_config",
message=sessions.JupyterConfig,
)
spark_connect_session: sessions.SparkConnectConfig = proto.Field(
proto.MESSAGE,
number=11,
oneof="session_config",
message=sessions.SparkConnectConfig,
)
creator: str = proto.Field(
proto.STRING,
number=5,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"DeleteSessionRequest",
"Session",
"JupyterConfig",
"SparkConnectConfig",
},
)

Expand Down Expand Up @@ -125,13 +126,16 @@ class ListSessionsRequest(proto.Message):
various fields in each session resource. Filters are case
sensitive, and may contain multiple clauses combined with
logical operators (AND, OR). Supported fields are
``session_id``, ``session_uuid``, ``state``, and
``create_time``.
``session_id``, ``session_uuid``, ``state``,
``create_time``, and ``labels``.
Example:
``state = ACTIVE and create_time < "2023-01-01T00:00:00Z"``
is a filter for sessions in an ACTIVE state that were
created before 2023-01-01.
``state = ACTIVE and labels.environment=production`` is a
filter for sessions in an ACTIVE state that have a
production environment label.
See https://google.aip.dev/assets/misc/ebnf-filtering.txt
for a detailed description of the filter syntax and a list
Expand Down Expand Up @@ -249,6 +253,11 @@ class DeleteSessionRequest(proto.Message):
class Session(proto.Message):
r"""A representation of a session.
This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.
.. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
Attributes:
Expand All @@ -264,6 +273,10 @@ class Session(proto.Message):
jupyter_session (google.cloud.dataproc_v1.types.JupyterConfig):
Optional. Jupyter session config.
This field is a member of `oneof`_ ``session_config``.
spark_connect_session (google.cloud.dataproc_v1.types.SparkConnectConfig):
Optional. Spark Connect session config.
This field is a member of `oneof`_ ``session_config``.
runtime_info (google.cloud.dataproc_v1.types.RuntimeInfo):
Output only. Runtime information about
Expand Down Expand Up @@ -388,6 +401,12 @@ class SessionStateHistory(proto.Message):
oneof="session_config",
message="JupyterConfig",
)
spark_connect_session: "SparkConnectConfig" = proto.Field(
proto.MESSAGE,
number=17,
oneof="session_config",
message="SparkConnectConfig",
)
runtime_info: shared.RuntimeInfo = proto.Field(
proto.MESSAGE,
number=6,
Expand Down Expand Up @@ -478,4 +497,8 @@ class Kernel(proto.Enum):
)


class SparkConnectConfig(proto.Message):
r"""Spark Connect configuration for an interactive session."""


__all__ = tuple(sorted(__protobuf__.manifest))
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"language": "PYTHON",
"name": "google-cloud-dataproc",
"version": "5.12.0"
"version": "0.1.0"
},
"snippets": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3293,6 +3293,7 @@ def test_create_session_rest(request_type):
"uuid": "uuid_value",
"create_time": {"seconds": 751, "nanos": 543},
"jupyter_session": {"kernel": 1, "display_name": "display_name_value"},
"spark_connect_session": {},
"runtime_info": {
"endpoints": {},
"output_uri": "output_uri_value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3412,6 +3412,7 @@ def test_create_session_template_rest(request_type):
"description": "description_value",
"create_time": {"seconds": 751, "nanos": 543},
"jupyter_session": {"kernel": 1, "display_name": "display_name_value"},
"spark_connect_session": {},
"creator": "creator_value",
"labels": {},
"runtime_config": {
Expand Down Expand Up @@ -3850,6 +3851,7 @@ def test_update_session_template_rest(request_type):
"description": "description_value",
"create_time": {"seconds": 751, "nanos": 543},
"jupyter_session": {"kernel": 1, "display_name": "display_name_value"},
"spark_connect_session": {},
"creator": "creator_value",
"labels": {},
"runtime_config": {
Expand Down

0 comments on commit 0d35003

Please sign in to comment.