Skip to content

Commit

Permalink
Fix lint issues, updated pre-commit to catch flake8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
visch committed Sep 23, 2023
1 parent 149b76c commit 2dd2af0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@ repos:
exclude: tests
additional_dependencies:
- types-paramiko
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
7 changes: 5 additions & 2 deletions tap_postgres/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from __future__ import annotations

import datetime
from contextlib import contextmanager
from typing import TYPE_CHECKING, Any, Dict, Iterable, Iterator, Optional, Type, Union
from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional, Type, Union

import psycopg2
import singer_sdk.helpers._typing
Expand Down Expand Up @@ -58,6 +57,10 @@ def __init__(
sqlalchemy_url: Optional URL for the connection.
"""

# Dates in postgres don't all convert to python datetime objects, so we
# need to register a custom type caster to convert these to a string
# See https://www.psycopg.org/psycopg3/docs/advanced/adapt.html#example-handling-infinity-date # noqa: E501
# For more information
if config is not None and config["dates_as_string"] is True:
string_dates = psycopg2.extensions.new_type(
(1082, 1114, 1184), "STRING_DATES", psycopg2.STRING
Expand Down
2 changes: 1 addition & 1 deletion tap_postgres/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import signal
from functools import cached_property
from os import chmod, path
from typing import Any, Dict, Mapping, cast
from typing import Any, Dict, cast

import paramiko
from singer_sdk import SQLTap, Stream
Expand Down

0 comments on commit 2dd2af0

Please sign in to comment.