Hotfix: Exponential Backoff TypeError - #58
Conversation
…EdFiSession.connect().
|
Update: I am still seeing the same error in long-running endpoint-ingestions. This fix is incomplete. I will outline below the lineage of how these methods are called from the Lots to step through here, but TL;DR: we never explicitly define or pass I'm confusing myself as I walk through the lineage here, but we need to force these arguments to always be defined at least once during init. |
|
We're hitting this because the code that accesses One option that immediately comes to mind is to assign defaults in |
Hotfix: Exponential Backoff (NoneType > Int) TypeError
Description & motivation
This PR resolves edu_edfi_airflow Issue #138.
There are two ways to initialize an
EdFiSession:EdFiClient.connect(): Intended approach (passes connection arguments into a new Session)EdFiClientinit: Builds a lazy session object that ignores retry arguments, expecting them to be overridden duringget_*calls.Our current version of
EdfiHookinedu_edfi_airflowuses the second method (i.e., it initializes a lazy session object but does not populate retry arguments). This led to a state where variables likemax_waitwere never initialized, leading toNoneTypeerrors during exponential backoff during ingestion.This PR simply updates the init for
EdFiSessionto populate global retry arguments when they're passed directly as kwargs during init.PR Merge Priority:
This is a breaking bug that prevents exponential backoff from running during production ingestions.
edfi_api_client/session.py: Populate instance attributes with kwargs when passed, instead of always defaulting to None.Tests and QC done:
Run successfully in SC prod. (Note that more runs are needed to ensure this has fully worked as intended.)