Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

dataflow: operation : Support shared config #720

Open
aghinsa opened this issue Jun 19, 2020 · 0 comments
Open

dataflow: operation : Support shared config #720

aghinsa opened this issue Jun 19, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@aghinsa
Copy link
Contributor

aghinsa commented Jun 19, 2020

Now we don't have a way for operations in dataflow to share objects.so if we have a dataflow,


configs:
  db_lookup:
    database:
      config:
        filename: test.db
      plugin: sqlite
  db_query:
    database:
      config:
        filename: test.db
      plugin: sqlite

two connections are made into the database as config is initialized two times.

A possible solution is to support something like

sdb = SqliteDatabase(SqliteDatabaseConfig(filename="test.db"))

dataflow = DataFlow(
    operations={
        "db_query": db_query_create_table.op,
        "db_lookup": db_query_lookup.op,
        "get_single": GetSingle.imp.op,
    },
    configs={"db_query": "db", "db_lookup": "db",},
    sharedconfigs={"db": DatabaseQueryConfig(database=sdb)},
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant