Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed the invalid seq for flake8 #5785

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,22 @@

import logging
import re
import pendulum
from collections import defaultdict
from typing import List, Mapping

import pendulum
from airbyte_cdk.models import AirbyteRecordMessage, ConfiguredAirbyteCatalog
from jsonschema import Draft7Validator, FormatChecker, ValidationError, FormatError
from jsonschema import Draft7Validator, FormatChecker, FormatError, ValidationError

timestamp_regex = re.compile(("^\d{4}-\d?\d-\d?\d" # date
"(\s|T)" # separator
"\d?\d:\d?\d:\d?\d(.\d+)?" # time
".*$" #timezone
))
# fmt: off
timestamp_regex = re.compile((r"^\d{4}-\d?\d-\d?\d" # date
r"(\s|T)" # separator
r"\d?\d:\d?\d:\d?\d(.\d+)?" # time
r".*$")) # timezone
# fmt: on


class CustomFormatChecker(FormatChecker):

@staticmethod
def check_datetime(value: str) -> bool:
valid_format = timestamp_regex.match(value)
Expand All @@ -59,7 +59,6 @@ def check(self, instance, format):
return super().check(instance, format)



def verify_records_schema(
records: List[AirbyteRecordMessage], catalog: ConfiguredAirbyteCatalog
) -> Mapping[str, Mapping[str, ValidationError]]:
Expand Down