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

Removed library imports from the worker #1046

Merged
merged 7 commits into from
Jun 15, 2022
Merged

Conversation

gavin-aguiar
Copy link
Contributor

@gavin-aguiar gavin-aguiar commented May 27, 2022

Removed library imports from the worker and only imported them in the function that they are used.

This should fix the users who have pinned their azure functions to a version older than 1.10.1.

Error seen for users with older pinned azure functions version
ERROR: unhandled error in functions worker,ImportError: cannot import name 'DataType' from 'azure.functions'

Description

Fixes #


PR information

  • The title of the PR is clear and informative.
  • There are a small number of commits, each of which has an informative message. This means that previously merged commits do not appear in the history of the PR. For information on cleaning up the commits in your pull request, see this page.
  • If applicable, the PR references the bug/issue that it fixes in the description.
  • New Unit tests were added for the changes made and CI is passing.

Quality of Code and Contribution Guidelines

@codecov
Copy link

codecov bot commented May 27, 2022

Codecov Report

Merging #1046 (8a80fbf) into dev (bcda54d) will increase coverage by 50.84%.
The diff coverage is 100.00%.

❗ Current head 8a80fbf differs from pull request most recent head b5c6caf. Consider uploading reports for the commit b5c6caf to get more accurate results

@@             Coverage Diff             @@
##              dev    #1046       +/-   ##
===========================================
+ Coverage   31.97%   82.81%   +50.84%     
===========================================
  Files          33       33               
  Lines        1764     1775       +11     
  Branches      282      282               
===========================================
+ Hits          564     1470      +906     
+ Misses       1199      235      -964     
- Partials        1       70       +69     
Flag Coverage Δ
unittests 82.81% <100.00%> (+50.84%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
azure_functions_worker/functions.py 96.04% <100.00%> (+71.88%) ⬆️
azure_functions_worker/loader.py 84.52% <100.00%> (+51.19%) ⬆️
azure_functions_worker/constants.py 100.00% <0.00%> (ø)
...ed_memory_data_transfer/shared_memory_constants.py 100.00% <0.00%> (ø)
azure_functions_worker/logging.py 40.90% <0.00%> (+4.54%) ⬆️
...ared_memory_data_transfer/file_accessor_factory.py 73.33% <0.00%> (+6.66%) ⬆️
azure_functions_worker/bindings/tracecontext.py 75.00% <0.00%> (+12.50%) ⬆️
azure_functions_worker/bindings/retrycontext.py 80.00% <0.00%> (+20.00%) ⬆️
azure_functions_worker/bindings/context.py 87.50% <0.00%> (+29.16%) ⬆️
...dings/shared_memory_data_transfer/file_accessor.py 84.37% <0.00%> (+31.25%) ⬆️
... and 17 more

Continue to review full report at Codecov.

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

@gavin-aguiar gavin-aguiar force-pushed the gaaguiar/import_handler branch from 296a1cc to 0784018 Compare May 31, 2022 16:09
@YunchuWang YunchuWang force-pushed the gaaguiar/import_handler branch from 0784018 to 387dd91 Compare May 31, 2022 17:01
@YunchuWang
Copy link
Member

@gavin-aguiar codecov failed, plz add some tests

@gavin-aguiar gavin-aguiar force-pushed the gaaguiar/import_handler branch from 387dd91 to 3c4f56d Compare June 1, 2022 20:57
@gavin-aguiar gavin-aguiar force-pushed the gaaguiar/import_handler branch from b3091c2 to ee43db3 Compare June 8, 2022 22:31
@gavin-aguiar gavin-aguiar force-pushed the gaaguiar/import_handler branch from 9b4b618 to 3a627df Compare June 14, 2022 19:03
@gavin-aguiar gavin-aguiar changed the title Added Library Importer to add dependencies from azure functions library Removed library imports from the worker Jun 14, 2022
@gavin-aguiar gavin-aguiar merged commit 98053f1 into dev Jun 15, 2022
@gavin-aguiar gavin-aguiar deleted the gaaguiar/import_handler branch June 15, 2022 17:42
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.

3 participants