Skip to content

Commit

Permalink
a23: change logs to GAVIN
Browse files Browse the repository at this point in the history
  • Loading branch information
Victoria Hall committed Feb 26, 2025
1 parent a533f81 commit 64d5dcf
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
14 changes: 7 additions & 7 deletions azure_functions_worker_v2/bindings/meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@

def _check_http_input_type_annotation(bind_name: str, pytype: type,
is_deferred_binding: bool) -> bool:
logger.info("VICTORIA --- http v2 enabled %s", (HttpV2Registry.http_v2_enabled()))
logger.info("GAVIN --- http v2 enabled %s", (HttpV2Registry.http_v2_enabled()))
if HttpV2Registry.http_v2_enabled():
return HttpV2Registry.ext_base().RequestTrackerMeta \
.check_type(pytype)

binding = get_binding(bind_name, is_deferred_binding)
logger.info("VICTORIA -- inside _check_http_input_type_annotation. Bind name: %s, binding: %s, pytype: %s, check: %s", bind_name, binding, pytype, binding.check_input_type_annotation(pytype))
logger.info("GAVIN -- inside _check_http_input_type_annotation. Bind name: %s, binding: %s, pytype: %s, check: %s", bind_name, binding, pytype, binding.check_input_type_annotation(pytype))
return binding.check_input_type_annotation(pytype)


Expand All @@ -45,7 +45,7 @@ def _check_http_output_type_annotation(bind_name: str, pytype: type) -> bool:
return HttpV2Registry.ext_base().ResponseTrackerMeta.check_type(pytype)

binding = get_binding(bind_name)
logger.info("VICTORIA -- inside _check_http_output_type_annotation. Bind name: %s, binding: %s, pytype: %s, check: %s", bind_name, binding, pytype, binding.check_output_type_annotation(pytype))
logger.info("GAVIN -- inside _check_http_output_type_annotation. Bind name: %s, binding: %s, pytype: %s, check: %s", bind_name, binding, pytype, binding.check_output_type_annotation(pytype))
return binding.check_output_type_annotation(pytype)


Expand All @@ -71,7 +71,7 @@ def load_binding_registry() -> None:

if func is None:
import azure.functions as func
logger.info(f"VICTORIA ---- azure-functions import succeeded: {func.__file__}")
logger.info(f"GAVIN ---- azure-functions import succeeded: {func.__file__}")

global BINDING_REGISTRY
BINDING_REGISTRY = func.get_binding_registry() # type: ignore
Expand Down Expand Up @@ -124,15 +124,15 @@ def is_trigger_binding(bind_name: str) -> bool:
def check_input_type_annotation(bind_name: str,
pytype: type,
is_deferred_binding: bool) -> bool:
logger.info("VICTORIA --- Inside check_input_type_annotation. bind_name: %s, pytype: %s", bind_name, pytype)
logger.info("GAVIN --- Inside check_input_type_annotation. bind_name: %s, pytype: %s", bind_name, pytype)
global INPUT_TYPE_CHECK_OVERRIDE_MAP
logger.info("VICTORIA --- bind_name in input type check map: %s", (bind_name in INPUT_TYPE_CHECK_OVERRIDE_MAP))
logger.info("GAVIN --- bind_name in input type check map: %s", (bind_name in INPUT_TYPE_CHECK_OVERRIDE_MAP))
if bind_name in INPUT_TYPE_CHECK_OVERRIDE_MAP:
return INPUT_TYPE_CHECK_OVERRIDE_MAP[bind_name](bind_name, pytype,
is_deferred_binding)

binding = get_binding(bind_name, is_deferred_binding)
logger.info("VICTORIA -- inside _check_http_input_type_annotation. Bind name: %s, binding: %s, pytype: %s, check: %s", bind_name, binding, pytype, binding.check_input_type_annotation(pytype))
logger.info("GAVIN -- inside _check_http_input_type_annotation. Bind name: %s, binding: %s, pytype: %s, check: %s", bind_name, binding, pytype, binding.check_input_type_annotation(pytype))

return binding.check_input_type_annotation(pytype)

Expand Down
12 changes: 6 additions & 6 deletions azure_functions_worker_v2/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def is_context_required(params, bound_params: dict,
def validate_function_params(params: dict, bound_params: dict,
annotations: dict, func_name: str,
protos):
logger.info("VICTORIA --- Params: %s, BoundParams: %s, Annotations: %s, FuncName: %s",
logger.info("GAVIN --- Params: %s, BoundParams: %s, Annotations: %s, FuncName: %s",
params, bound_params, annotations, func_name)
if set(params) - set(bound_params):
raise FunctionLoadError(
Expand All @@ -156,11 +156,11 @@ def validate_function_params(params: dict, bound_params: dict,

for param in params.values():
binding = bound_params[param.name]
logger.info("VICTORIA --- Param %s, binding: %s", param, binding)
logger.info("GAVIN --- Param %s, binding: %s", param, binding)

param_has_anno = param.name in annotations
param_anno = annotations.get(param.name)
logger.info("VICTORIA --- Param_has_anno %s, param_anno: %s", param_has_anno, param_anno)
logger.info("GAVIN --- Param_has_anno %s, param_anno: %s", param_has_anno, param_anno)

# Check if deferred bindings is enabled
fx_deferred_bindings_enabled, is_deferred_binding = (
Expand Down Expand Up @@ -210,7 +210,7 @@ def validate_function_params(params: dict, bound_params: dict,
else:
param_py_type = param_anno

logger.info("VICTORIA --- Param_py_type %s", param_py_type)
logger.info("GAVIN --- Param_py_type %s", param_py_type)

if (param_has_anno and not isinstance(param_py_type, type)
and not is_generic_type(param_py_type)):
Expand Down Expand Up @@ -239,7 +239,7 @@ def validate_function_params(params: dict, bound_params: dict,
else:
param_bind_type = binding.type

logger.info("VICTORIA --- param_bind_type %s", param_bind_type)
logger.info("GAVIN --- param_bind_type %s", param_bind_type)

if param_has_anno:
if is_param_out:
Expand All @@ -249,7 +249,7 @@ def validate_function_params(params: dict, bound_params: dict,
checks_out = check_input_type_annotation(
param_bind_type, param_py_type, is_deferred_binding)

logger.info("VICTORIA --- checks_out: %s",
logger.info("GAVIN --- checks_out: %s",
checks_out)

if not checks_out:
Expand Down
14 changes: 7 additions & 7 deletions azure_functions_worker_v2/handle_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ async def invocation_request(request):
logger.info("V2 Library Worker: received WorkerInvocationRequest")
global protos
invoc_request = request.request.invocation_request
logger.info("VICTORIA --- invocation request %s", invoc_request)
logger.info("GAVIN --- invocation request %s", invoc_request)
invocation_id = invoc_request.invocation_id
function_id = invoc_request.function_id
http_v2_enabled = False
threadpool = request.properties.get("threadpool")
logger.info("VICTORIA --- all variables obtained")
logger.info("GAVIN --- all variables obtained")

try:
fi: FunctionInfo = _functions.get_function(
Expand All @@ -170,10 +170,10 @@ async def invocation_request(request):
http_v2_enabled = _functions.get_function(
function_id).is_http_func and \
HttpV2Registry.http_v2_enabled()
logger.info("VICTORIA --- http_v2_enabled %s", http_v2_enabled)
logger.info("GAVIN --- http_v2_enabled %s", http_v2_enabled)

for pb in invoc_request.input_data:
logger.info("VICTORIA --- pb: %s", pb)
logger.info("GAVIN --- pb: %s", pb)
pb_type_info = fi.input_types[pb.name]
if is_trigger_binding(pb_type_info.binding_name):
trigger_metadata = invoc_request.trigger_metadata
Expand All @@ -189,7 +189,7 @@ async def invocation_request(request):
function_id).name,
is_deferred_binding=pb_type_info.deferred_bindings_enabled)

logger.info("VICTORIA --- args[pb.name]: %s", args[pb.name])
logger.info("GAVIN --- args[pb.name]: %s", args[pb.name])

if http_v2_enabled:
http_request = await http_coordinator.get_http_request_async(
Expand Down Expand Up @@ -248,7 +248,7 @@ async def invocation_request(request):
out_name=out_name,
protos=protos)
output_data.append(param_binding)
logger.info("VICTORIA --- output_data: %s", output_data)
logger.info("GAVIN --- output_data: %s", output_data)

return_value = None
if fi.return_type is not None and not http_v2_enabled:
Expand All @@ -258,7 +258,7 @@ async def invocation_request(request):
pytype=fi.return_type.pytype,
protos=protos
)
logger.info("VICTORIA --- return_value: %s", return_value)
logger.info("GAVIN --- return_value: %s", return_value)

# Actively flush customer print() function to console
sys.stdout.flush()
Expand Down
2 changes: 1 addition & 1 deletion azure_functions_worker_v2/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def index_function_app(function_path: str):
imported_module = importlib.import_module(module_name)

from azure.functions import FunctionRegister
logger.info(f"VICTORIA ---- FunctionRegister import succeeded: {FunctionRegister}")
logger.info(f"GAVIN ---- FunctionRegister import succeeded: {FunctionRegister}")
app: Optional[FunctionRegister] = None
for i in imported_module.__dir__():
if isinstance(getattr(imported_module, i, None), FunctionRegister):
Expand Down
2 changes: 1 addition & 1 deletion azure_functions_worker_v2/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

VERSION = '1.0.0a23'
VERSION = '1.0.0a24'

0 comments on commit 64d5dcf

Please sign in to comment.