Skip to content

Commit

Permalink
source-firebolt: Replace AirbyteLogger with logging.Logger (#38892)
Browse files Browse the repository at this point in the history
  • Loading branch information
girarda authored Jun 4, 2024
1 parent 29e0312 commit e6a094b
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data:
connectorSubtype: database
connectorType: source
definitionId: 6f2ac653-8623-43c4-8950-19218c7caf3d
dockerImageTag: 2.0.0
dockerImageTag: 2.0.2
dockerRepository: airbyte/source-firebolt
githubIssueLabel: source-firebolt
connectorBuildOptions:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",]
build-backend = "poetry.core.masonry.api"

[tool.poetry]
version = "2.0.0"
version = "2.0.2"
name = "source-firebolt"
description = "Source implementation for Firebolt."
authors = [ "Airbyte <contact@airbyte.io>",]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@


import json
import logging
from collections import defaultdict
from typing import Any, Dict, List, Tuple

from airbyte_cdk.logger import AirbyteLogger
from firebolt.async_db import Connection as AsyncConnection
from firebolt.async_db import connect as async_connect
from firebolt.client import DEFAULT_API_URL
Expand All @@ -26,12 +26,12 @@ def _determine_auth(key: str, secret: str) -> Auth:
return ClientCredentials(key, secret)


def parse_config(config: json, logger: AirbyteLogger) -> Dict[str, Any]:
def parse_config(config: json, logger: logging.Logger) -> Dict[str, Any]:
"""
Convert dict of config values to firebolt.db.Connection arguments
:param config: json-compatible dict of settings
:param logger: AirbyteLogger instance to print logs.
:param logger: logging.Logger instance to print logs.
:return: dictionary of firebolt.db.Connection-compatible kwargs
"""
Expand All @@ -55,12 +55,12 @@ def parse_config(config: json, logger: AirbyteLogger) -> Dict[str, Any]:
return connection_args


def establish_connection(config: json, logger: AirbyteLogger) -> Connection:
def establish_connection(config: json, logger: logging.Logger) -> Connection:
"""
Creates a connection to Firebolt database using the parameters provided.
:param config: Json object containing db credentials.
:param logger: AirbyteLogger instance to print logs.
:param logger: logging.Logger instance to print logs.
:return: PEP-249 compliant database Connection object.
"""
Expand All @@ -70,13 +70,13 @@ def establish_connection(config: json, logger: AirbyteLogger) -> Connection:
return connection


async def establish_async_connection(config: json, logger: AirbyteLogger) -> AsyncConnection:
async def establish_async_connection(config: json, logger: logging.Logger) -> AsyncConnection:
"""
Creates an async connection to Firebolt database using the parameters provided.
This connection can be used for parallel operations.
:param config: Json object containing db credentials.
:param logger: AirbyteLogger instance to print logs.
:param logger: logging.Logger instance to print logs.
:return: PEP-249 compliant database Connection object.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
#

import json
import logging
from typing import Dict, Generator

from airbyte_cdk.logger import AirbyteLogger
from airbyte_cdk.models import (
AirbyteCatalog,
AirbyteConnectionStatus,
Expand All @@ -24,7 +24,7 @@


class SourceFirebolt(Source):
def check(self, logger: AirbyteLogger, config: json) -> AirbyteConnectionStatus:
def check(self, logger: logging.Logger, config: json) -> AirbyteConnectionStatus:
"""
Tests if the input configuration can be used to successfully connect to the integration
e.g: if a provided Stripe API token can be used to connect to the Stripe API.
Expand All @@ -45,7 +45,7 @@ def check(self, logger: AirbyteLogger, config: json) -> AirbyteConnectionStatus:
except Exception as e:
return AirbyteConnectionStatus(status=Status.FAILED, message=f"An exception occurred: {str(e)}")

def discover(self, logger: AirbyteLogger, config: json) -> AirbyteCatalog:
def discover(self, logger: logging.Logger, config: json) -> AirbyteCatalog:
"""
Returns an AirbyteCatalog representing the available streams and fields in this integration.
For example, given valid credentials to a Postgres database,
Expand Down Expand Up @@ -79,7 +79,7 @@ def discover(self, logger: AirbyteLogger, config: json) -> AirbyteCatalog:

def read(
self,
logger: AirbyteLogger,
logger: logging.Logger,
config: json,
catalog: ConfiguredAirbyteCatalog,
state: Dict[str, any],
Expand Down
12 changes: 7 additions & 5 deletions docs/integrations/sources/firebolt.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ You can now use the Airbyte Firebolt source.

| Version | Date | Pull Request | Subject |
| :------ | :--------- | :------------------------------------------------------- | :----------------------------------------------------------- |
| 2.0.0 | 2024-06-01 | [36349](https://github.com/airbytehq/airbyte/pull/36349) | Service account authentication support |
| 1.0.0 | 2023-07-20 | [21842](https://github.com/airbytehq/airbyte/pull/21842) | PGDate, TimestampTZ, TimestampNTZ and Boolean column support |
| 0.2.1 | 2022-05-10 | [25965](https://github.com/airbytehq/airbyte/pull/25965) | Fix DATETIME conversion to Airbyte date-time type |
| 0.2.0 | 2022-09-09 | [16583](https://github.com/airbytehq/airbyte/pull/16583) | Reading from views |
| 0.1.0 | 2022-04-28 | [13874](https://github.com/airbytehq/airbyte/pull/13874) | Create Firebolt source |
| 2.0.2 | 2024-06-03 | [38892](https://github.com/airbytehq/airbyte/pull/38892) | Replace AirbyteLogger with logging.Logger |
| 2.0.1 | 2024-06-03 | [38892](https://github.com/airbytehq/airbyte/pull/38892) | Replace AirbyteLogger with logging.Logger |
| 2.0.0 | 2024-06-01 | [36349](https://github.com/airbytehq/airbyte/pull/36349) | Service account authentication support |
| 1.0.0 | 2023-07-20 | [21842](https://github.com/airbytehq/airbyte/pull/21842) | PGDate, TimestampTZ, TimestampNTZ and Boolean column support |
| 0.2.1 | 2022-05-10 | [25965](https://github.com/airbytehq/airbyte/pull/25965) | Fix DATETIME conversion to Airbyte date-time type |
| 0.2.0 | 2022-09-09 | [16583](https://github.com/airbytehq/airbyte/pull/16583) | Reading from views |
| 0.1.0 | 2022-04-28 | [13874](https://github.com/airbytehq/airbyte/pull/13874) | Create Firebolt source |

0 comments on commit e6a094b

Please sign in to comment.