-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Connector Registration and Dynamic Dispatch #1375
base: main
Are you sure you want to change the base?
Conversation
d4f5a7e
to
b92c85b
Compare
I like this a lot. I had taken a slightly different approach in #1282 and while there are things I like about my approach, as written it still tethers too closely to ingest. There are things I like about keeping it more object oriented (going for a method where we parse a |
So then this also aligns with where ingest should try to move towards - mainly, getting all the "template"/"config" pydantic models into |
I like this too. Is it possible to define required/optional args at a connector level rather than unpacking kwargs and receiving an error when pushing/pulling? Or would it conflict with the underlying ABC class? Thinking of having some level of type safety |
b92c85b
to
027e905
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1375 +/- ##
==========================================
+ Coverage 70.42% 70.85% +0.42%
==========================================
Files 115 124 +9
Lines 5979 6104 +125
Branches 695 706 +11
==========================================
+ Hits 4211 4325 +114
- Misses 1622 1629 +7
- Partials 146 150 +4 ☔ View full report in Codecov by Sentry. |
be2cfcb
to
24e1a06
Compare
@fvankrieken @sf-dcp I've changed things to find a nice potential middle-ground where we can type-safety, by just binding/configuring connectors at the lifecycle level. The idea being that for |
24e1a06
to
2a05958
Compare
7f2538d
to
e402142
Compare
also add mock dispatcher for FTP to illustrate the concept
e402142
to
d86b864
Compare
Implements dynamic (ie non-static / hardcoded) dispatcher for our connectors, at the lifecycle level. The idea is that if you define an destination type as, say,
ginger_ftp
as belowthen the distribution code should delegate the push to a connector registered as
ginger_ftp
.Impetus
This approach would enable others to register custom connectors. E.g. if another agency needed a
snowflake
connector, they could just register as here.Difficulties
Emphasis on the dynamic part here. We'd lose a lot of type-safety.Other Changes
lifecycle.distribute.socrata
to be a generic distributor (ie there should be nothing Socrata specific). The distributor should delegate to whatever connector is registered.lifecycle.scripts
.Super minor fixes
distribute
and other timesdistribution
. Standardize ondistribute
.