Skip to content

Commit

Permalink
Ignore long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Dec 22, 2023
1 parent a4c17e1 commit c9e4188
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions tap_postgres/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ def connector(self) -> PostgresConnector:
"""
# We mutate this url to use the ssh tunnel if enabled
url = make_url(self.get_sqlalchemy_url(config=self.config)) # type: ignore[arg-type]
url = make_url(self.get_sqlalchemy_url(config=self.config)) # type: ignore[arg-type] # noqa: E501
ssh_config = self.config.get("ssh_tunnel", {})

if ssh_config.get("enable", False):
Expand Down Expand Up @@ -530,7 +530,7 @@ def catalog(self) -> Catalog: # noqa: C901
stream_modified = False
new_stream = copy.deepcopy(stream)
if new_stream.replication_method == "LOG_BASED":
for property in new_stream.schema.properties.values(): # type: ignore[union-attr]
for property in new_stream.schema.properties.values(): # type: ignore[union-attr] # noqa: E501
if "null" not in property.type:
if isinstance(property.type, list):
property.type.append("null")
Expand All @@ -539,33 +539,37 @@ def catalog(self) -> Catalog: # noqa: C901
if new_stream.schema.required:
stream_modified = True
new_stream.schema.required = None
if "_sdc_deleted_at" not in new_stream.schema.properties: # type: ignore[operator]
if "_sdc_deleted_at" not in new_stream.schema.properties: # type: ignore[operator] # noqa: E501
stream_modified = True
new_stream.schema.properties.update(
{ # type: ignore[union-attr]
"_sdc_deleted_at": Schema(type=["string", "null"])
}
new_stream.schema.properties.update( # type: ignore[union-attr]
{
"_sdc_deleted_at": Schema(type=["string", "null"]),
},
)
new_stream.metadata.update(
{
("properties", "_sdc_deleted_at"): Metadata(
Metadata.InclusionType.AVAILABLE, True, None
)
}
Metadata.InclusionType.AVAILABLE,
True,
None,
),
},
)
if "_sdc_lsn" not in new_stream.schema.properties: # type: ignore[operator]
if "_sdc_lsn" not in new_stream.schema.properties: # type: ignore[operator] # noqa: E501
stream_modified = True
new_stream.schema.properties.update(
{ # type: ignore[union-attr]
"_sdc_lsn": Schema(type=["integer", "null"])
}
new_stream.schema.properties.update( # type: ignore[union-attr]
{
"_sdc_lsn": Schema(type=["integer", "null"]),
},
)
new_stream.metadata.update(
{
("properties", "_sdc_lsn"): Metadata(
Metadata.InclusionType.AVAILABLE, True, None
)
}
Metadata.InclusionType.AVAILABLE,
True,
None,
),
},
)
if stream_modified:
modified_streams.append(new_stream.tap_stream_id)
Expand All @@ -578,7 +582,7 @@ def catalog(self) -> Catalog: # noqa: C901
)
return new_catalog

def discover_streams(self) -> list[PostgresStream | PostgresLogBasedStream]: # type: ignore[override]
def discover_streams(self) -> list[PostgresStream | PostgresLogBasedStream]: # type: ignore[override] # noqa: E501
"""Initialize all available streams and return them as a list.
Returns:
Expand Down

0 comments on commit c9e4188

Please sign in to comment.