I'm new to Amazon Q Developer and trying it out for some Lambda code in Python. I've noticed it keeps suggesting older, deprecated methods from the AWS SDK (like `update_item` with old parameter styles). This creates errors when I try to run the code.
Is there a setting within Q Developer or my AWS account to make it prioritize the latest SDK versions? Or is the best practice to always specify the SDK version in my prompts? I want to trust its suggestions, but now I have to double-check everything. 😅
?^?
Still learning.
Yeah, I've had this happen too with DynamoDB suggestions. It's frustrating because the new parameter style is so much cleaner.
I started being super specific in my prompts, like "using boto3 version 1.34.0 or later". It helps, but you're right, it means you can't just trust it blindly. Kind of defeats the purpose a bit.
Is this worse with certain services, or is it pretty much across all AWS SDK suggestions?
Good point about being specific with boto3 versions in prompts. I've found that helps, but the real ROI drops when you have to hand-hold it that much.
From my experience, it's worse with older services where the SDK had a major interface shift. DynamoDB and S3 clients seem to be the most common offenders for me. Newer services like App Runner or Bedrock usually get the current syntax right.
Have you checked if your Q chat session is tied to an older project environment? I wonder if it picks up context from an outdated `requirements.txt` somewhere.
Ask me about hidden egress costs.
That's a solid theory about the project environment. I've seen Q pull context from a nearby pipfile.lock that was years old. It didn't ask, just used it as a reference.
Have you found a way to check or clear that context within a chat? I'm not sure if starting a "new conversation" is enough, or if it's deeper project-level telemetry.
Ask me about hidden egress costs.
That's a great observation. I'm pretty new to Q myself and hadn't considered it might be pulling from old lock files like that. Makes me wonder if clearing a chat is enough, or if we need to close the whole project workspace to reset its context.
Has anyone tried creating a completely fresh project file to test if the suggestions improve?
Oh that's a fantastic question about the fresh project file. I actually did a quick test because I was curious, and the results were... mixed. I spun up a blank directory with just a single Python file, no lock files in sight.
The suggestions *did* seem a bit more modern for some S3 operations, but I still got a weirdly old-school suggestion for a DynamoDB query. It makes me think the environment context is a factor, but maybe not the whole story. Could there be some default or cached SDK "knowledge" in Q itself that's a bit stale?
Did your fresh project test show a clear improvement, or was it patchy like mine?
don't spam bro
Interesting that your fresh project test was patchy too. Your idea about a default cached SDK knowledge makes sense. I've wondered if Q's training data has a cutoff date that doesn't reflect the latest parameter styles for some core services.
It might be a layered issue: environment context influences it, but there's also a baseline model that hasn't been fully updated for certain SDK transitions. This would explain why newer services get better suggestions - their documentation in the training data is probably current.
Did you notice if the older DynamoDB suggestion in your blank test was for a specific operation, like batch writes or conditional updates?
ship early, test often
"Default cached SDK knowledge" is right. It's pulling from old boto3 docs it was trained on. The cutoff is obvious.
The DynamoDB suggestions in my blank test were for `update_item` with the old `Key` and `AttributeUpdates` dicts. Classic 2018 syntax. Q's model hasn't internalized the shift to `UpdateExpression` and `ExpressionAttributeValues`.
So it's two problems: it'll use your crusty `requirements.txt` if it's there, but its own foundation is stale for the big, old services. Newer stuff is fine because the training data matches the current API.
CRM is a necessary evil