Граф коммитов

26 Коммитов

Автор SHA1 Сообщение Дата
hallvictoria 8214d0cec9
fix: enable missed return types for generic (#1485)
* tests, support for dict & httpresp

* support for returning list

* added support for int, double

* bool support, unit tests

---------

Co-authored-by: Victoria Hall <victoria.hall@microsoft.com>
2024-05-29 10:50:12 -05:00
hallvictoria a754e58e9e
fix: allow returning none for generic bindings (#1379)
* allow nill data for generic bindings

* tests

* lint

* added comment

* compatible with generic implicit output

* removed if cond

* revert return none supp

* added back support for returning None

* e2e test with generic bind and return none

---------

Co-authored-by: Varad Meru <vrdmr@users.noreply.github.com>
Co-authored-by: gavin-aguiar <80794152+gavin-aguiar@users.noreply.github.com>
Co-authored-by: Victoria Hall <victoria.hall@microsoft.com>
2024-04-18 11:33:56 -05:00
wangbill 2c77ac5d3c
feat: Http V2 Support (#1455)
* Http Proxy Support

Http Proxy Support

integration

refactor

update ext name

add to env reload

add dep

revert

* final changes and tests

* fix ppl

* revert

* fix

* fix

* fix

* fix

* flake8

* flake8

* flake8

* only run for 3.8+

* FIX

* skip tests for 3.7-

* fix

* fix

* fix

* fix

* fix styles

* fix

* s

* fix

* fix

* revert

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* tests

* fix

* test

* tests

* fix

* fix

* fix

* move init server

* fix

* test

* update ppls

* fix test

* fix tests

* fix

* fix

* fix

* Revert "fix"

This reverts commit bc9ca7f024.

* skip

* fix tests

* style

* test

* test

* ff

* test

* style

* skip

* test

* fix

* fix

* fix

* replay

* f

* fix

* codecov fix

* Mount base extension to fix consumption test failures

* style

* revert

* revert

* revert ppls

* test

* Revert "test"

This reverts commit 4142767813.

* address feedback

* revert ut ppl

* skip checking has http func

* fix test

* style

* revert cache ppl

* revert ppl

* pip fix

* try fix 3.7 ppl

* try

* oh meta

* fix

* fix

* fix

* dont pin fastapi to fix cmake err

* fix

* fix

* update azfunc base

* update

* feedback

* feedback

* feedback

* add docs

* merge fix

* feedback

* feedback

* feedback

* feedback

---------

Co-authored-by: hallvictoria <victoriahall@microsoft.com>
2024-04-12 14:10:04 -07:00
hallvictoria 330783f867
feat: SDK bindings changes (#1423)
* sdk working prototype

* misc

* new registry pseudo

* prototype changes

* weird dispatcher changes

* almost works

* working prototype!!

* reset flag

* support for mix & match in same func

* added pytype to decode()

* caching

* added tests

* revert later

* lint, clean up, templates

* reorder

* reorder again

* test pypi problems

* correct dir

* checking tests

* 404s

* investigating 500s

* no cache

* debugging

* more helpful debugging

* check raw bindings

* runtime error

* runtime error logging attempt

* local logger

* sys modules

* typo

* extensions version

* testing changes -- revert later

* added host logs

* spacing?

* debugging changes

* Moved dateutil to install_requires (#1443)

* Moved dateutil to install_requires

* Flake8 fixes

* Update Python Worker Version to 4.26.0

* net8 target framework

* stdout is not none

* tests pass locally

* updating extension versions

* temp table test fix

* table and eventhub test fix

* all blob tests

* merge with dev

* no importlib

* specific tests only for deferred bindings

* removed -e

* syntax

* ignore test, add back in cache

* revert eh and table tests

* blob extension resources

* >=3.9 support + test fixes

* lint

* removed testing changes

* lint again

* unit tests fix

* append to list

* fixes + tests

* reset flag, extra test

* revert meta changes, tests passing locally

* fixed tests

* fix unit test, import by default

* revert default import, meta refactoring

* fixed meta refactor

* added tests for helpers

* type syntax

* fixed tests

* actually fixed tests

* update base ext supported python version

* fixing unit test timeouts?

* setup.py too

* installing from .[deferred-bindings]

* update base ext supported python version again

* update var name in setup.py

* update var name in meta

* refactor tests into sep folder

* lint + install only .NET6

* remove script

* edit workflow

* import by default, misc fixes

* revert, only changed var name

* get_binding check

* revert get_binding check, import by default

* lint

* rename, replace None checks, comments

* fixed flag placement

* attribute error + lint

* fixed unit tests

* yml bug/feature reports

* moving flag set out of get_binding

* lint + 100

* add registry none check

* lint

* move check

* revert error raise

* changed order

* revert flag set

* loader registry none check

* adding back in checks

* reports & workflow feedback

* permissions + consumption

* feedback

* setup.py

* db test csproj

* remove 3.12

* combined db & e2e test workflow

* fixed consumption workflow

* fixed 3.7 tests

* skip all tests

* renamed registries as constants

* add flag as part of FunctionInfo + tests

* lint

* added logs (fails until new base)

* lint + base update

* changing bind_name (fails until exts)

* Revert "changing bind_name (fails until exts)"

This reverts commit 7971498bea.

* is_db property added to PTI

* fixed test

* quick log

* better log

* lint

* refactor FI + pin pip

* return cache val immediately

* install .[test-db] only for >=3.9

* fixing installation

* fixing installation pt2

* fixing installation pt3

* sep step for installations

* sep step for installations pt2

* closed if + semicolon

* updated refs to base

* updated refs to blob (rerun later)

* update setup.py

* remove import try/catch

* log bug fix

* unit tests

* pin pip

* log if base not found

* log delimiters

* removed f strings

* lint + feedback

* pydocs + default val

* get_raw_bindings method

* var names + docs

---------

Co-authored-by: gavin-aguiar <80794152+gavin-aguiar@users.noreply.github.com>
Co-authored-by: AzureFunctionsPython <funcdisc@microsoft.com>
Co-authored-by: Victoria Hall <victoria.hall@microsoft.com>
Co-authored-by: wangbill <12449837+YunchuWang@users.noreply.github.com>
2024-04-11 18:53:19 -05:00
hallvictoria c7ab3e94ed
Enabled implicit output for generic bindings (#1391)
* enabled implicit output for generic bindings

* should only fail durable tests?

* special case for table

* extra test for table

* special case for logic apps

* special case for durable

* fixing failing eventhub batch test

* added output binding

* flake

* eventhub output binding

* flake

* changed param name

* add_function prio explicit return type

* added tests

* added V2 test

* remove if cond for durable client

* lint

* Revert "remove if cond for durable client"

---------

Co-authored-by: peterstone2017 <12449837+YunchuWang@users.noreply.github.com>
2024-03-06 16:01:24 -06:00
gavin-aguiar f269c09764
Revert "Enabling implicit output for generic bindings (#1348)" (#1376)
This reverts commit a981fcf788.

Co-authored-by: root <root@GavinPC>
2023-12-01 18:04:21 -06:00
Varad Meru a981fcf788
Enabling implicit output for generic bindings (#1348)
* Enabling implicit output for generic bindings

* Fixing comments

---------

Co-authored-by: gavin-aguiar <80794152+gavin-aguiar@users.noreply.github.com>
2023-11-14 15:34:53 -06:00
gavin-aguiar 0f52efccc6
Retry policy support for v2 programming model (#1268)
* Retry policies

* Additional changes for retry policy

* Added retry policy support for v2 function

* Minor updates and added e2e tests

* Reverted change to worker config

* Added e2e tests

* Updated according to new libary

* Added tests

* Fixed existing tests

* Added unit tests

* Updated time format

* Updated time format

---------

Co-authored-by: Gavin Aguiar <gavin@GavinPC>
2023-07-06 16:59:34 -05:00
gavin-aguiar 91f0d4a5ae
Moving get_bindings_registry to static list (#1197)
* Moving get_bindings_registry to static list

* Flake8 fixes

* Shared memory tests fixes

* Fixinf eventhub unit tests

* Fixing consumption tests

* Revert "Fixing consumption tests"

This reverts commit b4f951a912.

* Fixing consumption tests

* Fixing durable functions unit tests

* Fixing remaining unit tests using mock load

* Adding comments

---------

Co-authored-by: Gavin Aguiar <gavin@GavinPC>
2023-03-16 11:02:30 -05:00
Evan a0f3c77c42
Enable logging from user threads (#1171)
* Add local thread storage to Context

* Add user threading testing folders

* Add E2E tests for thread and tpe

* Change threading.local() property name

* Define E2E tests

* Change type hint

* Change typehint to be consistent with the other uses

* Add async E2E tests

* Fix line too long error

* Fix thread test cases

* Fix tests naming and style

---------

Co-authored-by: evanroman <evanroman@microsoft.com>
Co-authored-by: gavin-aguiar <80794152+gavin-aguiar@users.noreply.github.com>
Co-authored-by: pdthummar <101662222+pdthummar@users.noreply.github.com>
2023-03-03 14:04:52 -06:00
peterstone2017 65d1bc6e47
Lazy Logging rather than in-line strings (#1067) 2022-10-18 17:03:49 -07:00
peterstone2017 068fbf8cd2
cookies get key hotfix (#1076)
Co-authored-by: peterstone2017 <yunchuwang5@gmail.com>
2022-07-26 16:38:26 -05:00
peterstone2017 c7a52362c0
Enable support for multiple Set-Cookie response headers (native & wsgi/asgi) (#1004)
* initial add cookies attempt

* exclude workindexing proto api from this pr

* Add parsing and nullable tests

* initial add cookies attempt

* exclude workindexing proto api from this pr

* delete random test

* update multi-ccokie tests;add pystein tests

* change to self.assertEqual

* fix flakey8

* fix flakey8

* make dateutil install required

* skip setting multi cookie headers test for py 3.7

* skip 3.7 multi cookie tests

* skip linux consumption tests until dateutil goes in

* flakey8 fix

* update cookie tests

* fix test

Co-authored-by: peterstone2017 <yunchuwang5@gmail.com>
2022-07-01 16:19:40 -05:00
Varad Meru 5e522fc610
Setting up dev as V4 branch for PyWorker (#936)
* Setting up dev as V4 branch for PyWorker
* Installing Dotnet 6 for AzurePipelines and GH Actions
* Disabling SharedMem tests from Mac, and disabling shm when disabled.
* Logging stdout errors, and adding proc kill for lingering processes
* Updating extension version in csproj
* Enable SharedMemory for Tests
* Adding extensionBundle info to host.json template
* Adding extension.csproj file for correctly loading extensions.dll
* Tweaking csproj for e2e tests
* Reintroducing Trace Logging
* Adding some sleep time
* Solving the timestamp timezone awareness issue
* Fixing UTs and E2E tests, setup.py changes, and v4 pipeline changes
* Formatting and Typo changes
* Refactoring azure.pipelines.yml file.
2022-02-04 14:35:36 -08:00
gavin-aguiar 291a85279f
Added Retry Context for python worker (#909)
* Retry context initial commit

* Added unit tests

* Fixed spacing

* Removed additional log

* Fixed Lint check errors

* Fixed line spacing errors

* Refactored get_context

* Reverting setup.py

* Updated setup.py

* Added doc links

Co-authored-by: Varad Meru <vrdmr@users.noreply.github.com>
2021-11-01 16:38:21 -07:00
Gohar Irfan Chaudhry 6e3ecd42bb
Using the cache for function bindings and not deleting shared memory resources upon request to close (#844)
* Separate field in the message to close shared memory maps which indicate if the maps should be deleted or just the reference should be dropped
* Check for function data cache capability from host
* Update azure_functions_worker/bindings/meta.py
* Addressing comments for cleaning up shared memory usage checks in meta.py
2021-10-01 18:32:22 -07:00
Hanzhang Zeng 7cee87120f
Python Worker Extension Interface (worker) (#815) 2021-04-01 16:12:03 -07:00
Gohar Irfan Chaudhry 9324efc5d4
Shared memory data transfer between Functions Host and Python worker (#816)
* Basic structure laid out for reading parameters from shared memory before passing to the function

* Writing output from worker to Shared Memory

* Put output from worker into Shared Memory

* Free shared memory resources after use

* Removed control flag from mmap header

* Proto change

* Working for blob shared memory data transfer; needs clean up, comments and tests

* Changing message for closing mmaps

* Support for string datatype for shared memory data transfer

* Change to oneof

* Use oneof in .proto

* Refactoring mmap_handler

* Refactoring, cleaning up and adding docstrings

* Updating CloseSharedMemoryResourcesResponse usage

* Fixing accidental changes to tests/*

* Addressing comments

* Basic structure laid out for reading parameters from shared memory before passing to the function

* Writing output from worker to Shared Memory

* Put output from worker into Shared Memory

* Free shared memory resources after use

* Removed control flag from mmap header

* Proto change

* Working for blob shared memory data transfer; needs clean up, comments and tests

* Changing message for closing mmaps

* Support for string datatype for shared memory data transfer

* Change to oneof

* Refactoring mmap_handler

* Refactoring, cleaning up and adding docstrings

* Updating CloseSharedMemoryResourcesResponse usage

* Fixing accidental changes to tests/*

* Addressing comments

* Cleaning up, addressing comments

* Following same class structure as the shared memory changes made for the host

* Moving shared memory data transfer related changes into separate directory

* Input error checks for shared memory map ctor

* Rebase fix

* Trying to make lint happy

* Making flake8 happy

* Fixing more lint issues

* Removing the use of __annotations__ to be compatible with Python 3.6, adding FileAccessor tests

* Added tests for FileAccessor, SharedMemoryMap, FileAccessorFactory

* Adding shared memory test setup for Unix

* Adding tests for SharedMemoryManager

* Adding tests to ensure the dispatcher can invoke the function and send/receive inputs over shared memory using a mock host

* More tests for worker/dispatcher's use of shared memory

* Using truncate instead of writing 0x00 byte manually upon creating mmap. More tests for multiple input/output blobs.

* Addressing comments

* Adding missing tests and doc strings for tests and their classes

* assertEqual -> assertTrue in test_dispose_without_delete_file

* Tried with blob trigger function - removed TODO

* Addressing comments

* Minor const fix

* Addressing comments

* Fixed test - removed unused test functions

* Addressing comments; caching list of valid directories for later use instead of checking every time

* Whitespace fix

* Cleanup

* Adding AppSetting to override shared memory directory for Unix - test setup for macOS

* Logging subprocess result in Exception

* Changed Exception -> IOError

* Check shared memory directory AppSetting only for Darwin tests

* Fix test cleanup for Darwin

* Only split AppSetting list of directories if the AppSetting was found

* Fix consts.UNIX_TEMP_DIRS

* Typo fix

* Adding throughput tests for blob input/output using shared memory

* Changing branch hardcode to instead use current branch

* Creating tests URL from current branch name

* Whitespace fixes

* Using tests from local dir

* Removing the need to use a URL for tests; just use from local directory

* Rename env variable to follow convention from host of using FUNCTIONS_

* Addressing comments

* Fixes for running tests on macOS

* Log which allowed directories for shared memory are being used

* Change assert -> raise

Co-authored-by: Hanzhang Zeng <48038149+Hazhzeng@users.noreply.github.com>
2021-03-24 10:53:56 -07:00
Hanzhang Zeng 62beb40018
Add EventHub metadata E2E testcases (#719)
* Fix syntax issue in azure-pipelinesyml

Fix an error in the elif statement
Fix an issue in nuspec_path variable reference

* Establish python_value and python_type contract with azure.functions.meta.Datum

* Add e2e test for eventhub generating by azure-eventhub library

* Remove unused datetime library

* Add batch trigger tests

* Replace eventhub using async interfaces

* Python 3.6 and 3.7 not support datetime.fromisostring

* EventHub timestamp is timezone aware

* Fix setup.py

* Add comments in EventHub trigger E2E tests

* Use docstring instead
2020-07-14 10:24:40 -07:00
Varad Meru 5d21acae03
Adding more Typing information as generated using monkeytype (#709)
* Type information added and other nit fixes
* Removed load_bindings()
* Fixing the types
* Update the crontab to run at 1 AM
2020-06-29 23:04:20 -07:00
Hanzhang Zeng 9d2a430c8e
Add copyright and license info in file header (#705)
* Add Microsoft copyright and MIT license headers
2020-06-26 14:42:10 -07:00
Hanzhang Zeng (Roger) 97b5d89806
Add durable functions support (#623)
* Added durable functions support by loosing return type checking

* bindings meta

* Revert "bindings meta"

This reverts commit e5e923d281.

* Revert "Revert "bindings meta""

This reverts commit 7196a903d2.

* We should fall back into builtin azure.functions
2020-02-28 11:22:49 -08:00
Yogesh Jagadeesan f7cf9507b4 Accept TraceContext from host (#554)
* Set correlation id in context

* Modified context being passed from host.

* Updated parameters

* Testing build. (This will be reverted).

* Unit test failure.

* code quality unit test failure.

* Code quality unit test.

* Indentation fix

* Updated DOTNET_VERSION and runtime version.

* Modified test and addressed code review comments

* Updated test

* Testing

* Modified test

* removed space

* New line at end of file
2020-01-16 12:35:33 -08:00
Hanzhang Zeng (Roger) c744bbb5b9
Pass bytes from invocation request metadata (#552)
* Make http.body always accepts raw_body

* Add image/png test and application/octet-stream test
2019-10-11 14:43:27 -07:00
Maheer Iqbal 0217fe4e70
Handle eventhub cardinality (#527) 2019-09-04 13:33:09 -07:00
Maheer Iqbal 015855dae2
Remove azure namespace (#506) 2019-08-01 15:33:09 -07:00