Skip to content

Commit

Permalink
Export Lambda module as aws_lambda instead of lambda_
Browse files Browse the repository at this point in the history
  • Loading branch information
unexge committed Nov 15, 2022
1 parent d82ea4e commit 75bd902
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ class PythonServerModuleGenerator(
private fun RustWriter.renderPyLambdaTypes() {
rustTemplate(
"""
let lambda_ = #{pyo3}::types::PyModule::new(py, "lambda_")?;
lambda_.add_class::<#{SmithyPython}::lambda::PyLambdaContext>()?;
let aws_lambda = #{pyo3}::types::PyModule::new(py, "aws_lambda")?;
aws_lambda.add_class::<#{SmithyPython}::lambda::PyLambdaContext>()?;
pyo3::py_run!(
py,
lambda_,
"import sys; sys.modules['$libName.lambda_'] = lambda_"
aws_lambda,
"import sys; sys.modules['$libName.aws_lambda'] = aws_lambda"
);
m.add_submodule(lambda_)?;
m.add_submodule(aws_lambda)?;
""",
*codegenScope,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from typing import List, Optional, Callable, Awaitable

from libpokemon_service_server_sdk import App
from libpokemon_service_server_sdk.lambda_ import LambdaContext # type: ignore
from libpokemon_service_server_sdk.aws_lambda import LambdaContext # type: ignore
from libpokemon_service_server_sdk.error import ResourceNotFoundException # type: ignore
from libpokemon_service_server_sdk.input import ( # type: ignore
DoNothingInput,
Expand Down

0 comments on commit 75bd902

Please sign in to comment.