Skip to content
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

[PYTHON] fix: load_config now returns empty dict instead of None when empty file #2596

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

kacpermuda
Copy link
Contributor

@kacpermuda kacpermuda commented Apr 10, 2024

Problem

Thanks to @rahul-madaan that noticed it. When an empty openlineage.yml is found, python client crashes during creation as the self.config is non-iterable (None).

Solution

Make sure the load_config() always returns a dict.

One-line summary:

utils.load_config() now returns empty dict instead of None when empty file to prevent OpenLineageClient crash

Checklist

  • You've signed-off your work
  • Your pull request title follows our guidelines
  • Your changes are accompanied by tests (if relevant)
  • Your change contains a small diff and is self-contained
  • You've updated any relevant documentation (if relevant)
  • Your comment includes a one-liner for the changelog about the specific purpose of the change (if necessary)
  • You've versioned the core OpenLineage model or facets according to SchemaVer (if relevant)
  • You've added a header to source files (if relevant)

SPDX-License-Identifier: Apache-2.0
Copyright 2018-2023 contributors to the OpenLineage project

@boring-cyborg boring-cyborg bot added the area:client/python openlineage-python label Apr 10, 2024
Signed-off-by: Kacper Muda <mudakacper@gmail.com>
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.84%. Comparing base (c9b06a4) to head (3308a69).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2596   +/-   ##
=======================================
  Coverage   84.84%   84.84%           
=======================================
  Files          59       59           
  Lines        3398     3398           
=======================================
  Hits         2883     2883           
  Misses        515      515           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@JDarDagran JDarDagran merged commit 53f320e into main Apr 11, 2024
30 checks passed
@JDarDagran JDarDagran deleted the fix-python-load-config branch April 11, 2024 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:client/python openlineage-python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants