Skip to content

Commit 8f6838b

Browse files
committed
Fix failing doctests
Signed-off-by: currantw <[email protected]>
1 parent 240c1eb commit 8f6838b

File tree

3 files changed

+51
-52
lines changed

3 files changed

+51
-52
lines changed

docs/user/ppl/cmd/expand.rst

+40-40
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ PPL query::
2828

2929
os> source=expand_flatten | expand teams | fields city, teams.name
3030
fetched rows / total rows = 7/7
31-
+--------------+--------------------+
32-
| city | teams.name |
33-
|--------------+--------------------|
34-
| Seattle | Seattle Seahawks |
35-
| Seattle | Seattle Kraken |
36-
| Vancouver | Vancouver Canucks |
37-
| Vancouver | BC Lions |
38-
| San Antonio | San Antonio Spurs |
39-
| Null City | null |
40-
| Missing City | null |
41-
+--------------+--------------------+
31+
+--------------+-------------------+
32+
| city | teams.name |
33+
|--------------+-------------------|
34+
| Seattle | Seattle Seahawks |
35+
| Seattle | Seattle Kraken |
36+
| Vancouver | Vancouver Canucks |
37+
| Vancouver | BC Lions |
38+
| San Antonio | San Antonio Spurs |
39+
| Null City | null |
40+
| Missing City | null |
41+
+--------------+-------------------+
4242

4343
Example 2: Expand a nested field
4444
=================================
@@ -47,15 +47,15 @@ PPL query::
4747

4848
os> source=expand_flatten | where city = 'San Antonio' | expand teams.title | fields teams.name, teams.title
4949
fetched rows / total rows = 5/5
50-
+-------------------+--------------+
51-
| teams.name | teams.title |
52-
|-------------------+--------------|
53-
| San Antonio Spurs | 1999 |
54-
| San Antonio Spurs | 2003 |
55-
| San Antonio Spurs | 2005 |
56-
| San Antonio Spurs | 2007 |
57-
| San Antonio Spurs | 2014 |
58-
+-------------------+--------------+
50+
+-------------------+-------------+
51+
| teams.name | teams.title |
52+
|-------------------+-------------|
53+
| San Antonio Spurs | 1999 |
54+
| San Antonio Spurs | 2003 |
55+
| San Antonio Spurs | 2005 |
56+
| San Antonio Spurs | 2007 |
57+
| San Antonio Spurs | 2014 |
58+
+-------------------+-------------+
5959

6060
Example 3: Expand multiple fields
6161
==================================
@@ -64,26 +64,26 @@ PPL query::
6464

6565
os> source=expand_flatten | expand teams | expand teams.title | fields teams.name, teams.title
6666
fetched rows / total rows = 16/16
67-
+-------------------+--------------+
68-
| teams.name | teams.title |
69-
|-------------------+--------------|
70-
| Seattle Seahawks | 2014 |
71-
| Seattle Kraken | null |
72-
| Vancouver Canucks | null |
73-
| BC Lions | 1964 |
74-
| BC Lions | 1985 |
75-
| BC Lions | 1994 |
76-
| BC Lions | 2000 |
77-
| BC Lions | 2006 |
78-
| BC Lions | 2011 |
79-
| San Antonio Spurs | 1999 |
80-
| San Antonio Spurs | 2003 |
81-
| San Antonio Spurs | 2005 |
82-
| San Antonio Spurs | 2007 |
83-
| San Antonio Spurs | 2014 |
84-
| null | null |
85-
| null | null |
86-
+-------------------+--------------+
67+
+-------------------+-------------+
68+
| teams.name | teams.title |
69+
|-------------------+-------------|
70+
| Seattle Seahawks | 2014 |
71+
| Seattle Kraken | null |
72+
| Vancouver Canucks | null |
73+
| BC Lions | 1964 |
74+
| BC Lions | 1985 |
75+
| BC Lions | 1994 |
76+
| BC Lions | 2000 |
77+
| BC Lions | 2006 |
78+
| BC Lions | 2011 |
79+
| San Antonio Spurs | 1999 |
80+
| San Antonio Spurs | 2003 |
81+
| San Antonio Spurs | 2005 |
82+
| San Antonio Spurs | 2007 |
83+
| San Antonio Spurs | 2014 |
84+
| null | null |
85+
| null | null |
86+
+-------------------+-------------+
8787

8888
Example 4: Expand and flatten a field
8989
=====================================

docs/user/ppl/cmd/flatten.rst

+10-10
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ PPL query::
2828

2929
os> source=expand_flatten | flatten location | fields city, country, province, coordinates, state
3030
fetched rows / total rows = 5/5
31-
+------------------+---------------+------------------+-----------------------------------------------+------------+
32-
| city | country | province | coordinates | state |
33-
|------------------+---------------+------------------+-----------------------------------------------+------------|
34-
| Seattle | United States | null | {'latitude': 47.6061, 'longitude': -122.3328} | Washington |
35-
| Vancouver | Canada | British Columbia | {'latitude': 49.2827, 'longitude': -123.1207} | null |
36-
| San Antonio | United States | null | {'latitude': 29.4252, 'longitude': -98.4946 | Texas |
37-
| Null City | null | null | null | null |
38-
| Missing City | null | null | null | null |
39-
+------------------+---------------+------------------+-----------------------------------------------+------------+
31+
+--------------+---------------+------------------+-----------------------------------------------+------------+
32+
| city | country | province | coordinates | state |
33+
|--------------+---------------+------------------+-----------------------------------------------+------------|
34+
| Seattle | United States | null | {'latitude': 47.6061, 'longitude': -122.3328} | Washington |
35+
| Vancouver | Canada | British Columbia | {'latitude': 49.2827, 'longitude': -123.1207} | null |
36+
| San Antonio | United States | null | {'latitude': 29.4252, 'longitude': -98.4946} | Texas |
37+
| Null City | null | null | null | null |
38+
| Missing City | null | null | null | null |
39+
+--------------+---------------+------------------+-----------------------------------------------+------------+
4040

4141
Example 2: Flatten multiple object fields
4242
=========================================
@@ -67,7 +67,7 @@ PPL query::
6767
|--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------|
6868
| Seattle | {'coordinates': {'latitude': 47.6061, 'longitude': -122.3328}, 'country': 'United States', 'state': 'Washington', 'latitude': 47.6061, 'longitude': -122.3328} |
6969
| Vancouver | {'coordinates': {'latitude': 49.2827, 'longitude': -123.1207}, 'country': 'Canada', 'province': 'British Columbia', 'latitude': 49.2827, 'longitude': -123.1207} |
70-
| San Antonio | {'coordinates': {'latitude': 29.4252, 'longitude': -98.4946 }, 'country': 'United States', 'state': 'Texas', 'latitude': 29.4252, 'longitude': -98.4946} |
70+
| San Antonio | {'coordinates': {'latitude': 29.4252, 'longitude': -98.4946}, 'country': 'United States', 'state': 'Texas', 'latitude': 29.4252, 'longitude': -98.4946} |
7171
| Null City | null |
7272
| Missing City | null |
7373
+--------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+

doctest/test_docs.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
DATASOURCES = ".ql-datasources"
3232
WEBLOGS = "weblogs"
3333
JSON_TEST = "json_test"
34-
EXPAND_FLATTEN = "expand"
35-
FLATTEN = "flatten"
34+
EXPAND_FLATTEN = "expand_flatten"
3635

3736
class DocTestConnection(OpenSearchConnection):
3837

0 commit comments

Comments
 (0)