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

MSSQL Server . Converting character string to smalldatetime type error #266

Closed
rmnguleria opened this issue Apr 5, 2016 · 2 comments
Closed

Comments

@rmnguleria
Copy link

Hi . I am connecting this with an MSSQL Server but getting this error while fetching :-

2016-04-05 16:15:49,014:ERROR:root:(pyodbc.DataError) ('22007', '[22007] [FreeTDS][SQL Server]Conversion failed when converting character string to smalldatetime data type. (295) (SQLExecDirectW)') [SQL: "SELECT TOP 50000 COUNT(*) AS count \nFROM [TRAVELER] \nWHERE BirthDate >= '2016-03-29 16:15:43.000000' AND BirthDate <= '2016-04-05 16:15:43.000000'"]
Traceback (most recent call last):
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/caravel/views.py", line 446, in explore
    payload = obj.get_json()
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/caravel/viz.py", line 240, in get_json
    'data': self.get_data(),
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/caravel/viz.py", line 342, in get_data
    df = self.get_df()
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/caravel/viz.py", line 334, in get_df
    df = super(TableViz, self).get_df(query_obj)
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/caravel/viz.py", line 132, in get_df
    self.results = self.datasource.query(**query_obj)
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/caravel/models.py", line 600, in query
    con=engine
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/pandas/io/sql.py", line 431, in read_sql_query
    parse_dates=parse_dates, chunksize=chunksize)
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/pandas/io/sql.py", line 1190, in read_query
    result = self.execute(*args)
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/pandas/io/sql.py", line 1081, in execute
    return self.connectable.execute(*args, **kwargs)
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1991, in execute
    return connection.execute(statement, *multiparams, **params)
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 906, in execute
    return self._execute_text(object, multiparams, params)
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1054, in _execute_text
    statement, parameters
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
    context)
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
    exc_info
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "/Users/rguleria/Documents/Stuff/Caravel/venv/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
DataError: (pyodbc.DataError) ('22007', '[22007] [FreeTDS][SQL Server]Conversion failed when converting character string to smalldatetime data type. (295) (SQLExecDirectW)') [SQL: "SELECT TOP 50000 COUNT(*) AS count \nFROM [TRAVELER] \nWHERE BirthDate >= '2016-03-29 16:15:43.000000' AND BirthDate <= '2016-04-05 16:15:43.000000'"]
@gbrian
Copy link
Contributor

gbrian commented Apr 5, 2016

Hi,
Same for me, check #185

@xrmx
Copy link
Contributor

xrmx commented Aug 8, 2016

Looks like a dup of #283, closing.

@xrmx xrmx closed this as completed Aug 8, 2016
graceguo-supercat pushed a commit to graceguo-supercat/superset that referenced this issue Oct 4, 2021
* docs: add durationFormatter example to number-format README.md

* docs: refactor example to use registry
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 17, 2021
* docs: add durationFormatter example to number-format README.md

* docs: refactor example to use registry
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 17, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 24, 2021
* docs: add durationFormatter example to number-format README.md

* docs: refactor example to use registry
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 24, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 25, 2021
* docs: add durationFormatter example to number-format README.md

* docs: refactor example to use registry
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 25, 2021
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 26, 2021
* docs: add durationFormatter example to number-format README.md

* docs: refactor example to use registry
zhaoyongjie pushed a commit to zhaoyongjie/incubator-superset that referenced this issue Nov 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants