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

Fix doctest data #1902

Merged
merged 1 commit into from
Aug 18, 2023
Merged

Conversation

Yury-Fridlyand
Copy link
Collaborator

@Yury-Fridlyand Yury-Fridlyand commented Jul 26, 2023

Description

Clean up doctest test data. Fortunately, no test failed due to incorrect import.
Doctest uses python client to manipulate with test data and it interpreted {"index":{"_id":"0"}} as a doc to import. Fortunately, opensearch DSL ignores such docs for queries being tested, so it didn't affect the test.

opensearchsql> select * from nested;
fetched rows / total rows = 4/4
+--------------+------------------------------+---------+-------------+------------------------------------------------+
| index        | comment                      | myNum   | someField   | message                                        |
|--------------+------------------------------+---------+-------------+------------------------------------------------|
| {'_id': '1'} | null                         | null    | null        | null                                           |
| null         | [{'data': 'ab', 'likes': 3}] | 1       | b           | [{'dayOfWeek': 1, 'author': 'e', 'info': 'a'}] |
| {'_id': '2'} | null                         | null    | null        | null                                           |
| null         | [{'data': 'aa', 'likes': 2}] | 2       | a           | [{'dayOfWeek': 2, 'author': 'f', 'info': 'b'}] |
+--------------+------------------------------+---------+-------------+------------------------------------------------+

opensearchsql> select message.info from nested;
fetched rows / total rows = 4/4
+----------------+
| message.info   |
|----------------|
| null           |
| a              |
| null           |
| b              |
+----------------+

opensearchsql> select nested(message.info) from nested;
fetched rows / total rows = 2/2
+----------------+
| message.info   |
|----------------|
| a              |
| b              |
+----------------+

opensearchsql> select * from wildcard;
fetched rows / total rows = 22/22
+---------------------------------------------+---------------+
| Body                                        | index         |
|---------------------------------------------+---------------|
| null                                        | {'_id': '0'}  |
| test wildcard                               | null          |
| null                                        | {'_id': '1'}  |
| test wildcard in the end of the text%       | null          |
| null                                        | {'_id': '2'}  |
| %test wildcard in the beginning of the text | null          |
| null                                        | {'_id': '3'}  |
| test wildcard in % the middle of the text   | null          |
| null                                        | {'_id': '4'}  |
| test wildcard %% beside each other          | null          |
| null                                        | {'_id': '5'}  |
| test wildcard in the end of the text_       | null          |
| null                                        | {'_id': '6'}  |
| _test wildcard in the beginning of the text | null          |
| null                                        | {'_id': '7'}  |
| test wildcard in _ the middle of the text   | null          |
| null                                        | {'_id': '8'}  |
| test wildcard __ beside each other          | null          |
| null                                        | {'_id': '9'}  |
| test backslash wildcard \_                  | null          |
| null                                        | {'_id': '10'} |
| tEsT wIlDcArD sensitive cases               | null          |
+---------------------------------------------+---------------+

Issues Resolved

Fix doctest samples.

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Yury-Fridlyand <[email protected]>
@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #1902 (b98b00a) into main (af12c02) will not change coverage.
Report is 2 commits behind head on main.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main    #1902   +/-   ##
=========================================
  Coverage     97.39%   97.39%           
  Complexity     4603     4603           
=========================================
  Files           401      401           
  Lines         11397    11397           
  Branches        835      835           
=========================================
  Hits          11100    11100           
  Misses          290      290           
  Partials          7        7           
Flag Coverage Δ
sql-engine 97.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

@acarbonetto acarbonetto removed the maintenance Improves code quality, but not the product label Jul 31, 2023
Copy link
Collaborator

@acarbonetto acarbonetto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's very odd how this was missed. Also very odd that doctests don't use the bulk endpoint.

@Yury-Fridlyand Yury-Fridlyand merged commit ff059f0 into opensearch-project:main Aug 18, 2023
@Yury-Fridlyand Yury-Fridlyand deleted the fix-doctest branch August 18, 2023 22:13
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 18, 2023
Signed-off-by: Yury-Fridlyand <[email protected]>
(cherry picked from commit ff059f0)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Yury-Fridlyand pushed a commit that referenced this pull request Aug 21, 2023
(cherry picked from commit ff059f0)

Signed-off-by: Yury-Fridlyand <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants