Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Not able to fetch null value result for doctest due to ExpressionEvaluationException #583

Closed
chloe-zh opened this issue Jul 17, 2020 · 1 comment

Comments

@chloe-zh
Copy link
Member

In our documentation, some examples have null values in the result set, doc test fails and throws ExpressionEvaluationException because the value of ExprNullValue expression is not fetch-able. Here follows an example:

Example in doc: od> SELECT POWER(-2, 0.5)

Expected result

    fetched rows / total rows = 1/1
    +----------------+
    | pow(-2, 0.5)   |
    |----------------+
    | null           |
    +----------------+

Actual output

File "/Users/..../sql/doctest/../docs/user/dql/functions.rst", line 581, in functions.rst
Failed example:
    sql_cmd.process('SELECT POWER(-2, 0.5)')Exception raised:
    Traceback (most recent call last):
      File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/doctest.py", line 1329, in __run
        compileflags, 1), test.globs)
      File "<doctest functions.rst[4]>", line 1, in <module>
        sql_cmd.process('SELECT POWER(-2, 0.5)')
      File "/Users/..../sql/doctest/test_docs.py", line 46, in process
        output = self.formatter.format_output(data)
      File "/Users/..../sql/doctest/.venv/lib/python3.7/site-packages/odfe_sql_cli/formatter.py", line 80, in format_output
        output = formatter.format_output(datarows, fields, **self.output_kwargs)
      File "/Users/..../sql/doctest/.venv/lib/python3.7/site-packages/cli_helpers/tabular_output/output_formatter.py", line 150, in format_output
        column_types = self._get_column_types(data)
      File "/Users/..../sql/doctest/.venv/lib/python3.7/site-packages/cli_helpers/tabular_output/output_formatter.py", line 158, in _get_column_types
        columns = list(zip_longest(*data))
    TypeError: zip_longest argument #1 must support iteration

@dai-chen
Copy link
Member

Null and missing data type is already supported in response: #667

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants