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

Format code #10837

Merged
merged 2 commits into from
Mar 3, 2022
Merged
Show file tree
Hide file tree
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 @@ -74,7 +74,7 @@ and `DATA` is not null
-- depends_on: __dbt__CTE__nested_stream_with_co_3es_partition_data_ab1
select
_airbyte_partition_hashid,
cast(currency as char) as currency,
cast(currency as char(1024)) as currency,
_airbyte_ab_id,
_airbyte_emitted_at,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ and double_array_data is not null
-- depends_on: __dbt__CTE__nested_stream_with_co_3double_array_data_ab1
select
_airbyte_partition_hashid,
cast(id as char) as id,
cast(id as char(1024)) as id,
_airbyte_ab_id,
_airbyte_emitted_at,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
-- depends_on: {{ ref('nested_stream_with_co_1g_into_long_names_ab1') }}
select
cast(id as {{ dbt_utils.type_string() }}) as id,
cast({{ adapter.quote('date') }} as {{ dbt_utils.type_string() }}) as {{ adapter.quote('date') }},
cast(id as {{ dbt_utils.type_string() }}(1024)) as id,
cast({{ adapter.quote('date') }} as {{ dbt_utils.type_string() }}(1024)) as {{ adapter.quote('date') }},
cast({{ adapter.quote('partition') }} as {{ type_json() }}) as {{ adapter.quote('partition') }},
_airbyte_ab_id,
_airbyte_emitted_at,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ and `DATA` is not null
-- depends_on: __dbt__CTE__nested_stream_with_co_3es_partition_data_ab1
select
_airbyte_partition_hashid,
cast(currency as char) as currency,
cast(currency as char(1024)) as currency,
_airbyte_ab_id,
_airbyte_emitted_at,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ and double_array_data is not null
-- depends_on: __dbt__CTE__nested_stream_with_co_3double_array_data_ab1
select
_airbyte_partition_hashid,
cast(id as char) as id,
cast(id as char(1024)) as id,
_airbyte_ab_id,
_airbyte_emitted_at,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ select
cast(id as
signed
) as id,
cast(currency as char) as currency,
cast(currency as char(1024)) as currency,
case when `date` = '' then NULL
else cast(`date` as date)
end as `date`
,
cast(nullif(timestamp_col, '') as char) as timestamp_col,
cast(nullif(timestamp_col, '') as char(1024)) as timestamp_col,
cast(`HKD@spéçiäl & characters` as
float
) as `HKD@spéçiäl & characters`,
cast(hkd_special___characters as char) as hkd_special___characters,
cast(hkd_special___characters as char(1024)) as hkd_special___characters,
cast(nzd as
float
) as nzd,
cast(usd as
float
) as usd,
cast(`column__'with"_quotes` as char) as `column__'with"_quotes`,
cast(`column__'with"_quotes` as char(1024)) as `column__'with"_quotes`,
_airbyte_ab_id,
_airbyte_emitted_at,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ select
cast(id as
signed
) as id,
cast(currency as char) as currency,
cast(currency as char(1024)) as currency,
case when `date` = '' then NULL
else cast(`date` as date)
end as `date`
,
cast(nullif(timestamp_col, '') as char) as timestamp_col,
cast(nullif(timestamp_col, '') as char(1024)) as timestamp_col,
cast(`HKD@spéçiäl & characters` as
float
) as `HKD@spéçiäl & characters`,
cast(hkd_special___characters as char) as hkd_special___characters,
cast(hkd_special___characters as char(1024)) as hkd_special___characters,
cast(nzd as
float
) as nzd,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ select
cast(id as
signed
) as id,
cast(`User Id` as char) as `User Id`,
cast(`User Id` as char(1024)) as `User Id`,
cast(user_id as
float
) as user_id,
Expand All @@ -47,7 +47,7 @@ select
cast(`user id_2` as
float
) as `user id_2`,
cast(`User@Id` as char) as `User@Id`,
cast(`User@Id` as char(1024)) as `User@Id`,
cast(userid as
float
) as userid,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
-- depends_on: {{ ref('dedup_exchange_rate_ab1') }}
select
cast(id as {{ dbt_utils.type_bigint() }}) as id,
cast(currency as {{ dbt_utils.type_string() }}) as currency,
cast(currency as {{ dbt_utils.type_string() }}(1024)) as currency,
case when {{ adapter.quote('date') }} = '' then NULL
else cast({{ adapter.quote('date') }} as date)
end as {{ adapter.quote('date') }}
,
cast({{ empty_string_to_null('timestamp_col') }} as {{ type_timestamp_with_timezone() }}) as timestamp_col,
cast({{ empty_string_to_null('timestamp_col') }} as {{ type_timestamp_with_timezone() }}(1024)) as timestamp_col,
cast({{ adapter.quote('HKD@spéçiäl & characters') }} as {{ dbt_utils.type_float() }}) as {{ adapter.quote('HKD@spéçiäl & characters') }},
cast(hkd_special___characters as {{ dbt_utils.type_string() }}) as hkd_special___characters,
cast(hkd_special___characters as {{ dbt_utils.type_string() }}(1024)) as hkd_special___characters,
cast(nzd as {{ dbt_utils.type_float() }}) as nzd,
cast(usd as {{ dbt_utils.type_float() }}) as usd,
_airbyte_ab_id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,23 @@ select
cast(id as
signed
) as id,
cast(currency as char) as currency,
cast(currency as char(1024)) as currency,
case when `date` = '' then NULL
else cast(`date` as date)
end as `date`
,
cast(nullif(timestamp_col, '') as char) as timestamp_col,
cast(nullif(timestamp_col, '') as char(1024)) as timestamp_col,
cast(`HKD@spéçiäl & characters` as
float
) as `HKD@spéçiäl & characters`,
cast(hkd_special___characters as char) as hkd_special___characters,
cast(hkd_special___characters as char(1024)) as hkd_special___characters,
cast(nzd as
float
) as nzd,
cast(usd as
float
) as usd,
cast(`column__'with"_quotes` as char) as `column__'with"_quotes`,
cast(`column__'with"_quotes` as char(1024)) as `column__'with"_quotes`,
_airbyte_ab_id,
_airbyte_emitted_at,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ select
cast(id as
signed
) as id,
cast(currency as char) as currency,
cast(currency as char(1024)) as currency,
case when `date` = '' then NULL
else cast(`date` as date)
end as `date`
,
cast(nullif(timestamp_col, '') as char) as timestamp_col,
cast(nullif(timestamp_col, '') as char(1024)) as timestamp_col,
cast(`HKD@spéçiäl & characters` as
float
) as `HKD@spéçiäl & characters`,
cast(hkd_special___characters as char) as hkd_special___characters,
cast(hkd_special___characters as char(1024)) as hkd_special___characters,
cast(nzd as
float
) as nzd,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,12 @@
"supportsIncremental": true,
"supportsNormalization": true,
"supportsDBT": false,
"supported_destination_sync_modes": [
"overwrite",
"append",
"append_dedup"
],
"supported_destination_sync_modes": ["overwrite", "append", "append_dedup"],
"connectionSpecification": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ClickHouse Destination Spec",
"type": "object",
"required": [
"host",
"port",
"database",
"username"
],
"required": ["host", "port", "database", "username"],
"additionalProperties": true,
"properties": {
"host": {
Expand All @@ -33,9 +24,7 @@
"minimum": 0,
"maximum": 65536,
"default": 8123,
"examples": [
"8123"
],
"examples": ["8123"],
"order": 1
},
"tcp-port": {
Expand All @@ -45,9 +34,7 @@
"minimum": 0,
"maximum": 65536,
"default": 9000,
"examples": [
"9000"
],
"examples": ["9000"],
"order": 2
},
"database": {
Expand Down Expand Up @@ -76,9 +63,7 @@
"oneOf": [
{
"title": "No Tunnel",
"required": [
"tunnel_method"
],
"required": ["tunnel_method"],
"properties": {
"tunnel_method": {
"description": "No ssh tunnel needed to connect to database",
Expand Down Expand Up @@ -117,9 +102,7 @@
"minimum": 0,
"maximum": 65536,
"default": 22,
"examples": [
"22"
],
"examples": ["22"],
"order": 2
},
"tunnel_user": {
Expand Down Expand Up @@ -167,9 +150,7 @@
"minimum": 0,
"maximum": 65536,
"default": 22,
"examples": [
"22"
],
"examples": ["22"],
"order": 2
},
"tunnel_user": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
"supportsIncremental": true,
"supportsNormalization": false,
"supportsDBT": false,
"supported_destination_sync_modes": [
"overwrite",
"append"
],
"supported_destination_sync_modes": ["overwrite", "append"],
"connectionSpecification": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Oracle Destination Spec",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@
#


from typing import Mapping, Any, Iterable
from typing import Any, Iterable, Mapping

from airbyte_cdk import AirbyteLogger
from airbyte_cdk.destinations import Destination
from airbyte_cdk.models import AirbyteConnectionStatus, ConfiguredAirbyteCatalog, AirbyteMessage, Status
from airbyte_cdk.models import AirbyteConnectionStatus, AirbyteMessage, ConfiguredAirbyteCatalog, Status


class DestinationScaffoldDestinationPython(Destination):
def write(
self,
config: Mapping[str, Any],
configured_catalog: ConfiguredAirbyteCatalog,
input_messages: Iterable[AirbyteMessage]
self, config: Mapping[str, Any], configured_catalog: ConfiguredAirbyteCatalog, input_messages: Iterable[AirbyteMessage]
) -> Iterable[AirbyteMessage]:

"""
Expand Down Expand Up @@ -54,6 +51,3 @@ def check(self, logger: AirbyteLogger, config: Mapping[str, Any]) -> AirbyteConn
return AirbyteConnectionStatus(status=Status.SUCCEEDED)
except Exception as e:
return AirbyteConnectionStatus(status=Status.FAILED, message=f"An exception occurred: {repr(e)}")



Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
"airbyte-cdk",
]

TEST_REQUIREMENTS = [
"pytest~=6.1"
]
TEST_REQUIREMENTS = ["pytest~=6.1"]

setup(
name="destination_scaffold_destination_python",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
"properties": {
"host": {
"description": "The host domain of the snowflake instance (must include the account, region, cloud environment, and end with snowflakecomputing.com). The account identifier differs depending on your cloud region, be sure to verify with Snowflake's documentation.",
"examples": ["accountname.us-east-2.aws.snowflakecomputing.com", "accountname.snowflakecomputing.com"],
"examples": [
"accountname.us-east-2.aws.snowflakecomputing.com",
"accountname.snowflakecomputing.com"
],
"type": "string",
"title": "Host",
"order": 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,12 @@
},
"reason_code": {
"type": ["string", "null"],
"enum": ["write_off", "subscription_change", "subscription_cancellation", "subscription_pause"]
"enum": [
"write_off",
"subscription_change",
"subscription_cancellation",
"subscription_pause"
]
},
"status": {
"type": ["string", "null"],
Expand Down Expand Up @@ -440,7 +445,7 @@
"minimum": 1
},
"refund_reason_code": {
"type": ["string","null"]
"type": ["string", "null"]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"date": {
"type": ["string"]
},
"customers": {
"type": ["integer"]
}
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"date": {
"type": ["string"]
},
"customers": {
"type": ["integer"]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ private Database getDatabase() {
Map.of(
"role", config.get("role").asText(),
"warehouse", config.get("warehouse").asText(),
"database", config.get("database").asText()
));
"database", config.get("database").asText()));
}

@Override
Expand Down
Loading