-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
73 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[run] | ||
omit = | ||
source_jira/run.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ requires = [ "poetry-core>=1.0.0",] | |
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.poetry] | ||
version = "3.3.0-rc.1" | ||
version = "3.3.0-rc.2" | ||
name = "source-jira" | ||
description = "Source implementation for Jira." | ||
authors = [ "Airbyte <[email protected]>",] | ||
|
@@ -17,7 +17,7 @@ include = "source_jira" | |
|
||
[tool.poetry.dependencies] | ||
python = "^3.10,<3.12" | ||
airbyte-cdk = "^5" | ||
airbyte-cdk = "^6" | ||
|
||
[tool.poetry.scripts] | ||
source-jira = "source_jira.run:run" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 45 additions & 6 deletions
51
airbyte-integrations/connectors/source-jira/source_jira/run.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,53 @@ | ||
# | ||
# Copyright (c) 2023 Airbyte, Inc., all rights reserved. | ||
# Copyright (c) 2024 Airbyte, Inc., all rights reserved. | ||
# | ||
|
||
|
||
import sys | ||
import traceback | ||
from datetime import datetime | ||
from typing import List | ||
|
||
from airbyte_cdk.entrypoint import launch | ||
from airbyte_cdk.entrypoint import AirbyteEntrypoint, launch, logger | ||
from airbyte_cdk.exception_handler import init_uncaught_exception_handler | ||
from airbyte_cdk.models import AirbyteErrorTraceMessage, AirbyteMessage, AirbyteMessageSerializer, AirbyteTraceMessage, TraceType, Type | ||
from orjson import orjson | ||
from source_jira import SourceJira | ||
|
||
|
||
def run(): | ||
source = SourceJira() | ||
launch(source, sys.argv[1:]) | ||
def _get_source(args: List[str]): | ||
catalog_path = AirbyteEntrypoint.extract_catalog(args) | ||
config_path = AirbyteEntrypoint.extract_config(args) | ||
state_path = AirbyteEntrypoint.extract_state(args) | ||
try: | ||
return SourceJira( | ||
SourceJira.read_catalog(catalog_path) if catalog_path else None, | ||
SourceJira.read_config(config_path) if config_path else None, | ||
SourceJira.read_state(state_path) if state_path else None, | ||
) | ||
except Exception as error: | ||
print( | ||
orjson.dumps( | ||
AirbyteMessageSerializer.dump( | ||
AirbyteMessage( | ||
type=Type.TRACE, | ||
trace=AirbyteTraceMessage( | ||
type=TraceType.ERROR, | ||
emitted_at=int(datetime.now().timestamp() * 1000), | ||
error=AirbyteErrorTraceMessage( | ||
message=f"Error starting the sync. This could be due to an invalid configuration or catalog. Please contact Support for assistance. Error: {error}", | ||
stack_trace=traceback.format_exc(), | ||
), | ||
), | ||
) | ||
) | ||
).decode() | ||
) | ||
return None | ||
|
||
|
||
def run() -> None: | ||
init_uncaught_exception_handler(logger) | ||
_args = sys.argv[1:] | ||
source = _get_source(_args) | ||
if source: | ||
launch(source, _args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters