Skip to content

Commit

Permalink
Remove unused logging.getLogger call (#364)
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajastro authored May 22, 2022
1 parent 295d943 commit ccb044d
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 35 deletions.
4 changes: 0 additions & 4 deletions astronomer/providers/amazon/aws/hooks/base_aws_async.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import logging

from aiobotocore.client import AioBaseClient
from aiobotocore.session import get_session
from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook, _parse_s3_config
from asgiref.sync import sync_to_async

log = logging.getLogger(__name__)


class AwsBaseHookAsync(AwsBaseHook):
"""Interacts with AWS using aiobotocore asynchronously."""
Expand Down
3 changes: 0 additions & 3 deletions astronomer/providers/amazon/aws/hooks/redshift_cluster.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import asyncio
import logging
from typing import Any, Dict

import botocore.exceptions

from astronomer.providers.amazon.aws.hooks.base_aws_async import AwsBaseHookAsync

log = logging.getLogger(__name__)


class RedshiftHookAsync(AwsBaseHookAsync):
"""Interact with AWS Redshift using aiobotocore python library"""
Expand Down
3 changes: 0 additions & 3 deletions astronomer/providers/amazon/aws/hooks/redshift_sql.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import asyncio
import logging
from typing import Dict, List, Union

import botocore.exceptions
from asgiref.sync import sync_to_async

from astronomer.providers.amazon.aws.hooks.redshift_data import RedshiftDataHook

log = logging.getLogger(__name__)


class RedshiftSQLHookAsync(RedshiftDataHook):
"""RedshiftSQL async hook inherits from RedshiftDataHook to interact with AWS redshift cluster database"""
Expand Down
3 changes: 0 additions & 3 deletions astronomer/providers/amazon/aws/hooks/s3.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import fnmatch
import logging
import os
import re
from datetime import datetime
Expand All @@ -10,8 +9,6 @@

from astronomer.providers.amazon.aws.hooks.base_aws_async import AwsBaseHookAsync

log = logging.getLogger(__name__)


class S3HookAsync(AwsBaseHookAsync):
"""Interact with AWS S3, using the aiobotocore library."""
Expand Down
3 changes: 0 additions & 3 deletions astronomer/providers/amazon/aws/sensors/redshift_cluster.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import logging
from typing import Any, Dict, Optional

from airflow.exceptions import AirflowException
Expand All @@ -9,8 +8,6 @@
RedshiftClusterSensorTrigger,
)

log = logging.getLogger(__name__)


class RedshiftClusterSensorAsync(RedshiftClusterSensor):
"""
Expand Down
3 changes: 0 additions & 3 deletions astronomer/providers/amazon/aws/sensors/s3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import logging
from datetime import datetime
from typing import Any, Callable, Dict, List, Optional, Sequence, Set, Union, cast
from urllib.parse import urlparse
Expand All @@ -15,8 +14,6 @@
S3PrefixTrigger,
)

log = logging.getLogger(__name__)


class S3KeySensorAsync(BaseOperator):
"""
Expand Down
3 changes: 0 additions & 3 deletions astronomer/providers/amazon/aws/triggers/s3.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import asyncio
import logging
from datetime import datetime
from typing import Any, AsyncIterator, Callable, Dict, List, Optional, Set, Tuple, Union

from airflow.triggers.base import BaseTrigger, TriggerEvent

from astronomer.providers.amazon.aws.hooks.s3 import S3HookAsync

log = logging.getLogger(__name__)


class S3KeyTrigger(BaseTrigger):
"""
Expand Down
3 changes: 0 additions & 3 deletions astronomer/providers/core/sensors/filesystem.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import logging
import os
from typing import Any, Dict, Optional

Expand All @@ -8,8 +7,6 @@

from astronomer.providers.core.triggers.filesystem import FileTrigger

log = logging.getLogger(__name__)


class FileSensorAsync(FileSensor):
"""
Expand Down
5 changes: 1 addition & 4 deletions astronomer/providers/core/triggers/filesystem.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import asyncio
import datetime
import logging
import os
import typing
from glob import glob
from typing import Any, Dict, Tuple

from airflow.triggers.base import BaseTrigger, TriggerEvent

log = logging.getLogger(__name__)


class FileTrigger(BaseTrigger):
"""
Expand Down Expand Up @@ -52,7 +49,7 @@ async def run(self) -> typing.AsyncIterator["TriggerEvent"]: # type: ignore[ove
if os.path.isfile(path):
mod_time_f = os.path.getmtime(path)
mod_time = datetime.datetime.fromtimestamp(mod_time_f).strftime("%Y%m%d%H%M%S")
log.info("Found File %s last modified: %s", str(path), str(mod_time))
self.log.info("Found File %s last modified: %s", str(path), str(mod_time))
yield TriggerEvent(True)
for _, _, files in os.walk(self.filepath):
if len(files) > 0:
Expand Down
3 changes: 0 additions & 3 deletions astronomer/providers/google/cloud/triggers/dataproc.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import asyncio
import logging
from typing import Any, AsyncIterator, Dict, Optional, Tuple

from airflow.triggers.base import BaseTrigger, TriggerEvent
from google.cloud.dataproc_v1.types import JobStatus

from astronomer.providers.google.cloud.hooks.dataproc import DataprocHookAsync

log = logging.getLogger(__name__)


class DataProcSubmitTrigger(BaseTrigger):
"""
Expand Down
3 changes: 0 additions & 3 deletions astronomer/providers/google/cloud/triggers/gcs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import asyncio
import logging
import os
from datetime import datetime
from typing import Any, AsyncIterator, Dict, List, Optional, Set, Tuple
Expand All @@ -10,8 +9,6 @@

from astronomer.providers.google.cloud.hooks.gcs import GCSHookAsync

log = logging.getLogger(__name__)


class GCSBlobTrigger(BaseTrigger):
"""
Expand Down

0 comments on commit ccb044d

Please sign in to comment.