Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudsearch CLI is facing issue to define-index-field for array type source field #7112

Open
dubesar opened this issue Jul 15, 2022 · 3 comments
Labels
bug This issue is a bug. cloudsearch customization Issues related to CLI customizations (located in /awscli/customizations) has-pr This issue has a PR associated with it. p2 This is a standard priority issue

Comments

@dubesar
Copy link

dubesar commented Jul 15, 2022

Describe the bug

Cloudsearch gives an option to define index-field with an associative source-field, So if we do -

aws cloudsearch define-index-field --domain-name test --name test_actors --type text-array --source-field actors

for a sample imdb dataset it creates a new index field have source field as it is specified. Now it should work with all fields like int, text, latlon, text-array, literals, literal-array etc. But facing issue in array type fields and its giving an error as -

Parameter validation failed:
Unknown parameter in IndexField.TextArrayOptions: "SourceField", must be one of: DefaultValue, SourceFields, ReturnEnabled, HighlightEnabled, AnalysisScheme

But this works fine for non-array fields giving the expected behaviour.

Expected Behavior

The expected behaviour is that after running for eg -

aws cloudsearch define-index-field --domain-name test --name test_actors --type text-array --source-field actors

it should create an index-field of type text-array with source field as specified.

Current Behavior

Currently facing issue for array-type fields stating -

Parameter validation failed:
Unknown parameter in IndexField.TextArrayOptions: "SourceField", must be one of: DefaultValue, SourceFields, ReturnEnabled, HighlightEnabled, AnalysisScheme

Reproduction Steps

Run this command after you have set up a sample domain for imdb dataset or any other set -

aws cloudsearch define-index-field --domain-name <domain-name> --name <index-name> --type text-array --source-field <source-field-name>

Possible Solution

You can refer to

https://github.com/boto/boto/blob/develop/boto/cloudsearch2/domain.py

for better understanding how array type fields have been handled. Also please look into the recent merge into cloudsearch.py file - https://github.com/aws/aws-cli/blob/master/awscli/customizations/cloudsearch.py

Additional Information/Context

Please also improve the test coverage at - https://github.com/aws/aws-cli/blob/master/tests/functional/cloudsearch/test_cloudsearch.py

CLI version used

aws-cli/2.7.15

Environment details (OS name and version, etc.)

AL2 Instance (DevDesktop)

@dubesar dubesar added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 15, 2022
@tim-finnigan tim-finnigan self-assigned this Jul 15, 2022
@tim-finnigan tim-finnigan added investigating This issue is being investigated and/or work is in progress to resolve the issue. cloudsearch and removed needs-triage This issue or PR still needs to be triaged. labels Jul 15, 2022
@tim-finnigan
Copy link
Contributor

Hi @dubesar thanks for reaching out. For reference here is the issue and PR related to that recent change you mentioned: #6017 and #6045.

Just to clarify, which changes are you suggesting should go in https://github.com/aws/aws-cli/blob/master/awscli/customizations/cloudsearch.py ?

Generally the service teams own and maintain their customizations, so we may want to loop in the CloudSearch team regarding changes here.

@tim-finnigan tim-finnigan added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed investigating This issue is being investigated and/or work is in progress to resolve the issue. labels Jul 15, 2022
@dubesar
Copy link
Author

dubesar commented Jul 15, 2022

Hello @tim-finnigan I am from the Cloudsearch team and we haven't made any changes to the customizations. Can I get to know who had made these changes? Were they from the AWS-CLI team? or some external contributors? And just want to know why it was merged almost after 1 year?

Also to answer your question regarding changes to go in -
We need to cover cases for array as currently only non array source-field are working fine.

@tim-finnigan
Copy link
Contributor

Hi @dubesar in my comment above I linked the issue and PR related to that change. Did you look at those? It appears that an external customer requested the feature and then created a PR to implement it.

Do you plan on creating a PR to implement the required changes? Please let us know what you need from the CLI team. We can also use our internal processes for discussing and tracking this.

@tim-finnigan tim-finnigan added customization Issues related to CLI customizations (located in /awscli/customizations) has-pr This issue has a PR associated with it. p2 This is a standard priority issue and removed response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. labels Nov 10, 2022
@tim-finnigan tim-finnigan removed their assignment Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. cloudsearch customization Issues related to CLI customizations (located in /awscli/customizations) has-pr This issue has a PR associated with it. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

2 participants