Skip to content

Fix test_adl for azure-datalake-store 1.0.1+ compatibility#866

Merged
rgbkrk merged 1 commit intonteract:mainfrom
Br1an67:fix/issue-825-fix-825
Mar 7, 2026
Merged

Fix test_adl for azure-datalake-store 1.0.1+ compatibility#866
rgbkrk merged 1 commit intonteract:mainfrom
Br1an67:fix/issue-825-fix-825

Conversation

@Br1an67
Copy link
Contributor

@Br1an67 Br1an67 commented Mar 7, 2026

Fixes #825

What does this PR do?

This PR fixes the test_create_adapter test in test_adl.py to be compatible with azure-datalake-store 1.0.1+.

The azure-datalake-store library removed the auth attribute from the lib module in version 1.0.1 (see upstream PR #333). This caused the test to fail with:

AttributeError: <module 'azure.datalake.store.lib'> does not have the attribute 'auth'

The fix adds create=True to the patch.object decorator, which allows mocking the auth attribute even when it doesn't exist in the module.

Changes

  • papermill/tests/test_adl.py: Added create=True parameter to @patch.object(adl_lib, 'auth', ...) decorator

Testing

Verified the fix works with azure-datalake-store 1.0.1:

papermill/tests/test_adl.py::ADLTest::test_create_adapter PASSED
papermill/tests/test_adl.py::ADLTest::test_listdir_calls_ls_on_adl_adapter PASSED
papermill/tests/test_adl.py::ADLTest::test_read_opens_and_reads_file PASSED
papermill/tests/test_adl.py::ADLTest::test_split_url_raises_exception_on_invalid_url PASSED
papermill/tests/test_adl.py::ADLTest::test_split_url_splits_valid_url PASSED
papermill/tests/test_adl.py::ADLTest::test_write_opens_file_and_writes_to_it PASSED

Diff stats

papermill/tests/test_adl.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

The azure-datalake-store library removed the 'auth' attribute from the
lib module in version 1.0.1. Add create=True to patch.object to allow
mocking the attribute even when it doesn't exist in the module.
@rgbkrk rgbkrk enabled auto-merge (squash) March 7, 2026 05:14
@rgbkrk rgbkrk merged commit 2503090 into nteract:main Mar 7, 2026
11 checks passed
@codecov
Copy link

codecov bot commented Mar 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.13%. Comparing base (cb2eb37) to head (588babf).
⚠️ Report is 35 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #866      +/-   ##
==========================================
- Coverage   91.54%   91.13%   -0.42%     
==========================================
  Files          17       17              
  Lines        1621     1635      +14     
==========================================
+ Hits         1484     1490       +6     
- Misses        137      145       +8     

see 5 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d8d155...588babf. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError:'azure.datalake.store.lib' does not have the attribute 'auth'

2 participants