Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiedemaria committed Jan 4, 2024
1 parent ba96225 commit 2ed484a
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions python_modules/dagster/dagster/_core/storage/db_io_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,27 +130,26 @@ def handle_output(self, context: OutputContext, obj: object) -> None:
"Unexpected 'None' output value. If a 'None' value is intentional, set the output type to None.",
)

table_slice = self._get_table_slice(context, context)

if obj is not None:
obj_type = type(obj)
self._check_supported_type(obj_type)
obj_type = type(obj)
self._check_supported_type(obj_type)

with self._db_client.connect(context, table_slice) as conn:
self._db_client.ensure_schema_exists(context, table_slice, conn)
self._db_client.delete_table_slice(context, table_slice, conn)
table_slice = self._get_table_slice(context, context)

handler_metadata = self._handlers_by_type[obj_type].handle_output(
context, table_slice, obj, conn
)
with self._db_client.connect(context, table_slice) as conn:
self._db_client.ensure_schema_exists(context, table_slice, conn)
self._db_client.delete_table_slice(context, table_slice, conn)

context.add_output_metadata(
{
**(handler_metadata or {}),
"Query": self._db_client.get_select_statement(table_slice),
}
handler_metadata = self._handlers_by_type[obj_type].handle_output(
context, table_slice, obj, conn
)

context.add_output_metadata(
{
**(handler_metadata or {}),
"Query": self._db_client.get_select_statement(table_slice),
}
)

def load_input(self, context: InputContext) -> object:
obj_type = context.dagster_type.typing_type
if obj_type is Any and self._default_load_type is not None:
Expand Down

0 comments on commit 2ed484a

Please sign in to comment.