Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
AstrakhantsevaAA committed Feb 6, 2024
1 parent 69982c8 commit 284426f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
18 changes: 6 additions & 12 deletions sources/kafka/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@
from contextlib import closing
from typing import Any, Callable, Dict, Iterable, List, Optional, Union

from confluent_kafka import Consumer, Message # type: ignore

import dlt
from confluent_kafka import Consumer, Message # type: ignore
from dlt.common import logger
from dlt.common.time import ensure_pendulum_datetime
from dlt.common.typing import TDataItem, TAnyDateTime
from .helpers import (
default_msg_processor,
KafkaCredentials,
OffsetTracker,
)
from dlt.common.typing import TAnyDateTime, TDataItem

from .helpers import KafkaCredentials, OffsetTracker, default_msg_processor


@dlt.resource(
Expand Down Expand Up @@ -68,10 +64,8 @@ def kafka_consumer(
consumer = credentials.init_consumer()
else:
raise TypeError(
(
"Wrong credentials type provided. Need to be of type: "
"KafkaCredentials or confluent_kafka.Consumer"
)
"Wrong credentials type provided. Need to be of type: "
"KafkaCredentials or confluent_kafka.Consumer"
)

if start_from is not None:
Expand Down
3 changes: 1 addition & 2 deletions sources/kafka/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

from confluent_kafka import Consumer, Message, TopicPartition # type: ignore
from confluent_kafka.admin import AdminClient, TopicMetadata # type: ignore

from dlt.common import pendulum
from dlt.common.configuration import configspec
from dlt.common.configuration.specs import CredentialsConfiguration
from dlt.common.time import ensure_pendulum_datetime
from dlt.common.typing import DictStrAny, TSecretValue, TAnyDateTime
from dlt.common.typing import DictStrAny, TSecretValue
from dlt.common.utils import digest128


Expand Down
4 changes: 3 additions & 1 deletion tests/jira/test_jira_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ def test_load_query_issues(destination_name: str) -> None:
# tables are typed dicts
users_table = data_tables[0]
assert users_table["name"] == "issues"
assert load_table_counts(pipeline, "issues") == {"issues": 11} # values are changing (decrease)
assert load_table_counts(pipeline, "issues") == {
"issues": 11
} # values are changing (decrease)
# distinct. actually, we have only 10 unique issues in the project
assert load_table_distinct_counts(pipeline, "id", "issues") == {"issues": 10}

0 comments on commit 284426f

Please sign in to comment.