From 24104891a4fb79e49ded7e7d4678d2f1b135f585 Mon Sep 17 00:00:00 2001 From: Colton Padden Date: Wed, 21 Aug 2024 11:05:27 -0400 Subject: [PATCH] fix indentation, add missing docstring to appease our sphinx lords --- python_modules/dagster-pipes/dagster_pipes/__init__.py | 9 +++++++++ python_modules/dagster/dagster/_config/config_type.py | 2 ++ .../dagster/dagster/_core/execution/context/system.py | 6 ++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/python_modules/dagster-pipes/dagster_pipes/__init__.py b/python_modules/dagster-pipes/dagster_pipes/__init__.py index 2bab83a8b3357..57e5a628ad6b6 100644 --- a/python_modules/dagster-pipes/dagster_pipes/__init__.py +++ b/python_modules/dagster-pipes/dagster_pipes/__init__.py @@ -907,6 +907,15 @@ def __init__( self._key_prefix = key_prefix def upload_messages_chunk(self, payload: IO, index: int) -> None: + """Uploads a chunk of messages to an S3 bucket. + + Args: + payload (IO): The payload containing the messages to upload. + index (int): The index of the chunk. + + Returns: + None + """ key = f"{self._key_prefix}/{index}.json" if self._key_prefix else f"{index}.json" self._client.put_object( Body=payload.read(), diff --git a/python_modules/dagster/dagster/_config/config_type.py b/python_modules/dagster/dagster/_config/config_type.py index 5be54d599cf36..1c496c3a470c4 100644 --- a/python_modules/dagster/dagster/_config/config_type.py +++ b/python_modules/dagster/dagster/_config/config_type.py @@ -335,6 +335,7 @@ def from_python_enum(cls, enum, name=None): The name for the enum. If not present, `enum.__name__` will be used. Example: + .. code-block:: python class Color(enum.Enum): @@ -365,6 +366,7 @@ def from_python_enum_direct_values(cls, enum, name=None): The name for the enum. If not present, `enum.__name__` will be used. Example: + .. code-block:: python class Color(enum.Enum): diff --git a/python_modules/dagster/dagster/_core/execution/context/system.py b/python_modules/dagster/dagster/_core/execution/context/system.py index 1f935be08554f..7b707ce72f809 100644 --- a/python_modules/dagster/dagster/_core/execution/context/system.py +++ b/python_modules/dagster/dagster/_core/execution/context/system.py @@ -1086,8 +1086,7 @@ def asset_partitions_time_window_for_output(self, output_name: str) -> TimeWindo Raises an error if either of the following are true: - The output asset has no partitioning. - - The output asset is not partitioned with a TimeWindowPartitionsDefinition or a - MultiPartitionsDefinition with one time-partitioned dimension. + - The output asset is not partitioned with a TimeWindowPartitionsDefinition or a MultiPartitionsDefinition with one time-partitioned dimension. """ partitions_def = self._partitions_def_for_output(output_name) @@ -1156,8 +1155,7 @@ def asset_partitions_time_window_for_input(self, input_name: str) -> TimeWindow: Raises an error if either of the following are true: - The input asset has no partitioning. - - The input asset is not partitioned with a TimeWindowPartitionsDefinition or a - MultiPartitionsDefinition with one time-partitioned dimension. + - The input asset is not partitioned with a TimeWindowPartitionsDefinition or a MultiPartitionsDefinition with one time-partitioned dimension. """ asset_layer = self.job_def.asset_layer upstream_asset_key = asset_layer.asset_key_for_input(self.node_handle, input_name)