Skip to content

Commit

Permalink
Fixed leaky connection
Browse files Browse the repository at this point in the history
  • Loading branch information
Gilbert09 committed Oct 28, 2024
1 parent e960789 commit 31b1542
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
19 changes: 0 additions & 19 deletions posthog/temporal/data_imports/pipelines/rest_source/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,22 +372,3 @@ def identity_func(x: Any) -> Any:
if incremental_param.end:
params[incremental_param.end] = transform(incremental_object.end_value)
return params


# XXX: This is a workaround pass test_dlt_init.py
# since the source uses dlt.source as a function
# def _register_source(source_func: Callable[..., DltSource]) -> None:
# import inspect
# from dlt.common.configuration import get_fun_spec
# from dlt.common.source import _SOURCES, SourceInfo

# spec = get_fun_spec(source_func)
# func_module = inspect.getmodule(source_func)
# _SOURCES[source_func.__name__] = SourceInfo(
# SPEC=spec,
# f=source_func,
# module=func_module,
# )


# _register_source(rest_api_source)
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,7 @@ def sql_database(

# use provided tables or all tables
if table_names:
tables = [
Table(name, metadata, inherit_cache=False, autoload_with=None if defer_table_reflect else engine)
for name in table_names
]
tables = [Table(name, metadata, autoload_with=None if defer_table_reflect else engine) for name in table_names]
else:
if defer_table_reflect:
raise ValueError("You must pass table names to defer table reflection")
Expand All @@ -232,7 +229,7 @@ def sql_database(

for table in tables:
yield sql_table(
credentials=credentials,
credentials=engine,
table=table.name,
schema=table.schema,
metadata=metadata,
Expand Down

0 comments on commit 31b1542

Please sign in to comment.