Skip to content

Commit 46a7d0e

Browse files
committed
Address reviews
1 parent 75dcd7c commit 46a7d0e

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators/ConfigGenerator.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ private void generateConfig(GenerationContext context, PythonWriter writer) {
343343

344344
// Only add config resolution imports if there are descriptor properties
345345
if (hasDescriptors) {
346-
writer.addDependency(SmithyPythonDependency.SMITHY_CORE);
346+
writer.addDependency(SmithyPythonDependency.SMITHY_AWS_CORE);
347347
writer.addImport("smithy_aws_core.config.property", "ConfigProperty");
348348
writer.addImport("smithy_aws_core.config.resolver", "ConfigResolver");
349349
writer.addImport("smithy_aws_core.config.sources", "EnvironmentSource");
@@ -580,17 +580,19 @@ public void write(PythonWriter writer, String previousText, ConfigSection sectio
580580
}
581581

582582
writer.write(previousText);
583+
writer.addImport("smithy_aws_core.config.source_info", "SourceInfo");
583584

584585
writer.write("""
585586
586-
def get_source(self, key: str) -> str | None:
587+
def get_source(self, key: str) -> SourceInfo | None:
587588
\"""Get the source that provided a configuration value.
588589
589590
Args:
590591
key: The configuration key (e.g., 'region', 'retry_strategy')
591592
592593
Returns:
593-
The source name ('instance', 'environment', etc.),
594+
The source info (SimpleSource('source_name') or
595+
ComplexSource({"retry_mode": "source1", "max_attempts": "source2"})),
594596
or None if the key hasn't been resolved yet.
595597
\"""
596598
cached = self.__dict__.get(f'_cache_{key}')

0 commit comments

Comments
 (0)