fivetran-connector-sdk 1.2.0__py3-none-any.whl → 1.2.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fivetran_connector_sdk/__init__.py +41 -11
- {fivetran_connector_sdk-1.2.0.dist-info → fivetran_connector_sdk-1.2.1.dist-info}/METADATA +1 -1
- {fivetran_connector_sdk-1.2.0.dist-info → fivetran_connector_sdk-1.2.1.dist-info}/RECORD +6 -6
- {fivetran_connector_sdk-1.2.0.dist-info → fivetran_connector_sdk-1.2.1.dist-info}/WHEEL +1 -1
- {fivetran_connector_sdk-1.2.0.dist-info → fivetran_connector_sdk-1.2.1.dist-info}/entry_points.txt +0 -0
- {fivetran_connector_sdk-1.2.0.dist-info → fivetran_connector_sdk-1.2.1.dist-info}/top_level.txt +0 -0
| @@ -31,7 +31,7 @@ from fivetran_connector_sdk.protos import connector_sdk_pb2_grpc | |
| 31 31 |  | 
| 32 32 | 
             
            # Version format: <major_version>.<minor_version>.<patch_version>
         | 
| 33 33 | 
             
            # (where Major Version = 1 for GA, Minor Version is incremental MM from Jan 25 onwards, Patch Version is incremental within a month)
         | 
| 34 | 
            -
            __version__ = "1.2. | 
| 34 | 
            +
            __version__ = "1.2.1"
         | 
| 35 35 |  | 
| 36 36 | 
             
            MAC_OS = "mac"
         | 
| 37 37 | 
             
            WIN_OS = "windows"
         | 
| @@ -162,7 +162,8 @@ class Operations: | |
| 162 162 | 
             
                    Returns:
         | 
| 163 163 | 
             
                        list[connector_sdk_pb2.UpdateResponse]: A list of update responses.
         | 
| 164 164 | 
             
                    """
         | 
| 165 | 
            -
                     | 
| 165 | 
            +
                    if DEBUGGING:
         | 
| 166 | 
            +
                        _yield_check(inspect.stack())
         | 
| 166 167 |  | 
| 167 168 | 
             
                    responses = []
         | 
| 168 169 |  | 
| @@ -200,7 +201,8 @@ class Operations: | |
| 200 201 | 
             
                    Returns:
         | 
| 201 202 | 
             
                        connector_sdk_pb2.UpdateResponse: The update response.
         | 
| 202 203 | 
             
                    """
         | 
| 203 | 
            -
                     | 
| 204 | 
            +
                    if DEBUGGING:
         | 
| 205 | 
            +
                        _yield_check(inspect.stack())
         | 
| 204 206 |  | 
| 205 207 | 
             
                    table = get_renamed_table_name(table)
         | 
| 206 208 | 
             
                    columns = _get_columns(table)
         | 
| @@ -226,7 +228,8 @@ class Operations: | |
| 226 228 | 
             
                    Returns:
         | 
| 227 229 | 
             
                        connector_sdk_pb2.UpdateResponse: The delete response.
         | 
| 228 230 | 
             
                    """
         | 
| 229 | 
            -
                     | 
| 231 | 
            +
                    if DEBUGGING:
         | 
| 232 | 
            +
                        _yield_check(inspect.stack())
         | 
| 230 233 |  | 
| 231 234 | 
             
                    table = get_renamed_table_name(table)
         | 
| 232 235 | 
             
                    columns = _get_columns(table)
         | 
| @@ -262,7 +265,9 @@ class Operations: | |
| 262 265 | 
             
                    Returns:
         | 
| 263 266 | 
             
                        connector_sdk_pb2.UpdateResponse: The checkpoint response.
         | 
| 264 267 | 
             
                    """
         | 
| 265 | 
            -
                     | 
| 268 | 
            +
                    if DEBUGGING:
         | 
| 269 | 
            +
                        _yield_check(inspect.stack())
         | 
| 270 | 
            +
             | 
| 266 271 | 
             
                    return connector_sdk_pb2.UpdateResponse(
         | 
| 267 272 | 
             
                        operation=connector_sdk_pb2.Operation(checkpoint=connector_sdk_pb2.Checkpoint(
         | 
| 268 273 | 
             
                            state_json=json.dumps(state))))
         | 
| @@ -432,8 +437,6 @@ def _yield_check(stack): | |
| 432 437 | 
             
                # the file paths. This can lead to unexpected behavior, such as yield returning None or
         | 
| 433 438 | 
             
                # the failure to retrieve the module inside a frozen app
         | 
| 434 439 | 
             
                # (Reference: https://github.com/pyinstaller/pyinstaller/issues/5963)
         | 
| 435 | 
            -
                if not DEBUGGING:
         | 
| 436 | 
            -
                    return
         | 
| 437 440 |  | 
| 438 441 | 
             
                called_method = stack[0].function
         | 
| 439 442 | 
             
                calling_code = stack[1].code_context[0]
         | 
| @@ -1755,6 +1758,20 @@ def edit_distance(first_string: str, second_string: str) -> int: | |
| 1755 1758 | 
             
                return previous_row[second_string_length]
         | 
| 1756 1759 |  | 
| 1757 1760 |  | 
| 1761 | 
            +
            def get_input_from_cli(prompt : str, default_value: str) -> str:
         | 
| 1762 | 
            +
                """
         | 
| 1763 | 
            +
                Prompts the user for input.
         | 
| 1764 | 
            +
                """
         | 
| 1765 | 
            +
                if default_value:
         | 
| 1766 | 
            +
                    value = input(f"{prompt} [Default : {default_value}]: ").strip() or default_value
         | 
| 1767 | 
            +
                else:
         | 
| 1768 | 
            +
                    value = input(f"{prompt}: ").strip()
         | 
| 1769 | 
            +
             | 
| 1770 | 
            +
                if not value:
         | 
| 1771 | 
            +
                    raise ValueError("Missing required input: Expected a value but received None")
         | 
| 1772 | 
            +
                return value or None
         | 
| 1773 | 
            +
             | 
| 1774 | 
            +
             | 
| 1758 1775 | 
             
            def main():
         | 
| 1759 1776 | 
             
                """The main entry point for the script.
         | 
| 1760 1777 | 
             
                Parses command line arguments and passes them to connector object methods
         | 
| @@ -1794,9 +1811,9 @@ def main(): | |
| 1794 1811 | 
             
                    sys.exit(1)
         | 
| 1795 1812 |  | 
| 1796 1813 | 
             
                # Process optional args
         | 
| 1797 | 
            -
                ft_group = args.destination if args.destination else  | 
| 1798 | 
            -
                ft_connection = args.connection if args.connection else  | 
| 1799 | 
            -
                ft_deploy_key = args.api_key if args.api_key else  | 
| 1814 | 
            +
                ft_group = args.destination if args.destination else None
         | 
| 1815 | 
            +
                ft_connection = args.connection if args.connection else None
         | 
| 1816 | 
            +
                ft_deploy_key = args.api_key if args.api_key else None
         | 
| 1800 1817 | 
             
                hd_agent_id = args.hybrid_deployment_agent_id if args.hybrid_deployment_agent_id else os.getenv(FIVETRAN_HD_AGENT_ID, None)
         | 
| 1801 1818 | 
             
                configuration = args.configuration if args.configuration else None
         | 
| 1802 1819 | 
             
                state = args.state if args.state else os.getenv('FIVETRAN_STATE', None)
         | 
| @@ -1804,14 +1821,27 @@ def main(): | |
| 1804 1821 | 
             
                configuration = validate_and_load_configuration(args, configuration)
         | 
| 1805 1822 | 
             
                state = validate_and_load_state(args, state)
         | 
| 1806 1823 |  | 
| 1824 | 
            +
                FIVETRAN_API_KEY = os.getenv('FIVETRAN_API_KEY', None)
         | 
| 1825 | 
            +
                FIVETRAN_DESTINATION_NAME = os.getenv('FIVETRAN_DESTINATION_NAME', None)
         | 
| 1826 | 
            +
                FIVETRAN_CONNECTION_NAME = os.getenv('FIVETRAN_CONNECTION_NAME', None)
         | 
| 1827 | 
            +
             | 
| 1807 1828 | 
             
                if args.command.lower() == "deploy":
         | 
| 1808 1829 | 
             
                    if args.state:
         | 
| 1809 1830 | 
             
                        print_library_log("'state' parameter is not used for 'deploy' command", Logging.Level.WARNING)
         | 
| 1831 | 
            +
             | 
| 1832 | 
            +
                    if not ft_deploy_key:
         | 
| 1833 | 
            +
                        ft_deploy_key = get_input_from_cli("Please provide the API Key", FIVETRAN_API_KEY)
         | 
| 1834 | 
            +
             | 
| 1835 | 
            +
                    if not ft_group:
         | 
| 1836 | 
            +
                        ft_group = get_input_from_cli("Please provide the destination", FIVETRAN_DESTINATION_NAME)
         | 
| 1837 | 
            +
             | 
| 1838 | 
            +
                    if not ft_connection:
         | 
| 1839 | 
            +
                        ft_connection = get_input_from_cli("Please provide the connection name",FIVETRAN_CONNECTION_NAME)
         | 
| 1840 | 
            +
             | 
| 1810 1841 | 
             
                    connector_object.deploy(args, ft_deploy_key, ft_group, ft_connection, hd_agent_id, configuration)
         | 
| 1811 1842 |  | 
| 1812 1843 | 
             
                elif args.command.lower() == "debug":
         | 
| 1813 1844 | 
             
                    connector_object.debug(args.project_path, configuration, state)
         | 
| 1814 | 
            -
             | 
| 1815 1845 | 
             
                else:
         | 
| 1816 1846 | 
             
                    if not suggest_correct_command(args.command):
         | 
| 1817 1847 | 
             
                        raise NotImplementedError(f"Invalid command: {args.command}, see `fivetran --help`")
         | 
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            Metadata-Version: 2.2
         | 
| 2 2 | 
             
            Name: fivetran_connector_sdk
         | 
| 3 | 
            -
            Version: 1.2. | 
| 3 | 
            +
            Version: 1.2.1
         | 
| 4 4 | 
             
            Summary: Build custom connectors on Fivetran platform
         | 
| 5 5 | 
             
            Author-email: Fivetran <developers@fivetran.com>
         | 
| 6 6 | 
             
            Project-URL: Homepage, https://fivetran.com/docs/connectors/connector-sdk
         | 
| @@ -1,4 +1,4 @@ | |
| 1 | 
            -
            fivetran_connector_sdk/__init__.py,sha256= | 
| 1 | 
            +
            fivetran_connector_sdk/__init__.py,sha256=3Kp8MaT8ZtvrOo_dNGFGt5mdumojUSPhYwNL7x6CBvE,80242
         | 
| 2 2 | 
             
            fivetran_connector_sdk/protos/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
         | 
| 3 3 | 
             
            fivetran_connector_sdk/protos/common_pb2.py,sha256=kUwVcyZHgLigNR-KnHZn7dHrlxaMnUXqzprsRx6T72M,6831
         | 
| 4 4 | 
             
            fivetran_connector_sdk/protos/common_pb2.pyi,sha256=S0hdIzoXyyOKD5cjiGeDDLYpQ9J3LjAvu4rCj1JvJWE,9038
         | 
| @@ -6,8 +6,8 @@ fivetran_connector_sdk/protos/common_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXH | |
| 6 6 | 
             
            fivetran_connector_sdk/protos/connector_sdk_pb2.py,sha256=9Ke_Ti1s0vAeXapfXT-EryrT2-TSGQb8mhs4gxTpUMk,7732
         | 
| 7 7 | 
             
            fivetran_connector_sdk/protos/connector_sdk_pb2.pyi,sha256=FWYxRgshEF3QDYAE0TM_mv4N2gGvkxCH_uPpxnMc4oA,8406
         | 
| 8 8 | 
             
            fivetran_connector_sdk/protos/connector_sdk_pb2_grpc.py,sha256=ZfJLp4DW7uP4pFOZ74s_wQ6tD3eIPi-08UfnLwe4tzo,7163
         | 
| 9 | 
            -
            fivetran_connector_sdk-1.2. | 
| 10 | 
            -
            fivetran_connector_sdk-1.2. | 
| 11 | 
            -
            fivetran_connector_sdk-1.2. | 
| 12 | 
            -
            fivetran_connector_sdk-1.2. | 
| 13 | 
            -
            fivetran_connector_sdk-1.2. | 
| 9 | 
            +
            fivetran_connector_sdk-1.2.1.dist-info/METADATA,sha256=3h_7qvx3Wv4GvLUTsNnTx2CLWCZpHtVTi-H-vScF4wA,2967
         | 
| 10 | 
            +
            fivetran_connector_sdk-1.2.1.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
         | 
| 11 | 
            +
            fivetran_connector_sdk-1.2.1.dist-info/entry_points.txt,sha256=uQn0KPnFlQmXJfxlk0tifdNsSXWfVlnAFzNqjXZM_xM,57
         | 
| 12 | 
            +
            fivetran_connector_sdk-1.2.1.dist-info/top_level.txt,sha256=-_xk2MFY4psIh7jw1lJePMzFb5-vask8_ZtX-UzYWUI,23
         | 
| 13 | 
            +
            fivetran_connector_sdk-1.2.1.dist-info/RECORD,,
         | 
    
        {fivetran_connector_sdk-1.2.0.dist-info → fivetran_connector_sdk-1.2.1.dist-info}/entry_points.txt
    RENAMED
    
    | 
            File without changes
         | 
    
        {fivetran_connector_sdk-1.2.0.dist-info → fivetran_connector_sdk-1.2.1.dist-info}/top_level.txt
    RENAMED
    
    | 
            File without changes
         |