Fix panic on secondary index Options None unwrap#11
Merged
lusingander merged 1 commit intolusingander:masterfrom Sep 28, 2025
Merged
Fix panic on secondary index Options None unwrap#11lusingander merged 1 commit intolusingander:masterfrom
lusingander merged 1 commit intolusingander:masterfrom
Conversation
Backtrace:
```
thread 'tokio-runtime-worker' panicked at src/client.rs:233:55:
called `Option::unwrap()` on a `None` value
stack backtrace:
0: rust_begin_unwind
1: core::panicking::panic_fmt
2: core::panicking::panic
3: core::option::unwrap_failed
4: ddv::client::<impl core::convert::From<aws_sdk_dynamodb::types::_local_secondary_index_description::LocalSecondaryIndexDescription> for ddv::data::LocalSecondaryIndexDescription>::from
5: alloc::vec::in_place_collect::from_iter_in_place
6: ddv::client::to_table_description
7: ddv::app::App::load_table_description::{{closure}}
8: tokio::runtime::task::raw::poll
9: tokio::runtime::scheduler::multi_thread::worker::Context::run_task
10: tokio::runtime::scheduler::multi_thread::worker::Context::run
11: tokio::runtime::context::runtime::enter_runtime
12: tokio::runtime::scheduler::multi_thread::worker::run
13: <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll
14: tokio::runtime::task::core::Core<T,S>::poll
15: tokio::runtime::task::harness::Harness<T,S>::poll
16: tokio::runtime::blocking::pool::Inner::run
```
Table which error occur can be created locally (don't know if happens on
AWS) with:
```sh
aws dynamodb create-table \
--table-name test1 \
--endpoint-url http://localhost:8000 \
--attribute-definitions \
AttributeName=c_id,AttributeType=N \
AttributeName=main_id,AttributeType=S \
AttributeName=main_number,AttributeType=S \
--key-schema \
AttributeName=c_id,KeyType=HASH \
AttributeName=main_id,KeyType=RANGE \
--local-secondary-indexes '[
{
"IndexName": "main_number",
"KeySchema": [
{"AttributeName": "c_id", "KeyType": "HASH"},
{"AttributeName": "main_number", "KeyType": "RANGE"}
],
"Projection": {"ProjectionType": "ALL"}
}
]' \
--billing-mode PAY_PER_REQUEST
```
Contributor
Author
|
After i open this pull request i realize wasn't using aws dynamodb image locally, but moto for dynamo service, so this is probably a incomplete implementation by moto. Sorry for this pull request. |
Owner
|
Thanks for reporting this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backtrace:
Table which error occur can be created locally (don't know if happens on AWS) with:
aws dynamodb create-table \ --table-name test1 \ --endpoint-url http://localhost:8000 \ --attribute-definitions \ AttributeName=c_id,AttributeType=N \ AttributeName=main_id,AttributeType=S \ AttributeName=main_number,AttributeType=S \ --key-schema \ AttributeName=c_id,KeyType=HASH \ AttributeName=main_id,KeyType=RANGE \ --local-secondary-indexes '[ { "IndexName": "main_number", "KeySchema": [ {"AttributeName": "c_id", "KeyType": "HASH"}, {"AttributeName": "main_number", "KeyType": "RANGE"} ], "Projection": {"ProjectionType": "ALL"} } ]' \ --billing-mode PAY_PER_REQUEST