Skip to content

Not possible to create syncing DB connection #145

@gelin

Description

@gelin

The syncing DB connections, as described in Import API are POSTs with JSON content to "/api/v1/synchronizations" where both connector and interval are defined. Also, actually there are null data import urls (archive) there.

The code in datasets.py does not allow to do this:

    def is_sync_table(self, archive, interval, **import_args):
        return (hasattr(archive, "startswith") and archive.startswith("http")
                or "connection" in import_args)    # this is true for DB connections
            and interval is not None               # this also is true for syncing connections

    def create(self, archive, interval=None, **import_args):
        # ...
        if self.is_sync_table(archive, interval, **import_args):  # true for syncing DB connection
            manager = SyncTableJobManager(self.client)
        else:
            manager = FileImportJobManager(self.client)

        if interval is None:
            import_job = manager.create(archive)  # different signature for different managers (out of this issue)
            import_job.run(**import_args)
        else:
            import_job = manager.create(archive, interval)  # this is called for SyncTableJobManager
            # !!! import_args (including "connection") are just ignored and not POSTed later
        # ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions