We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
CAST('2024-01-01 00:00:00' AS DATETIMEOFFSET)
Ibis will raise an error when I use a statement with CAST AS DATETIMEOFFSET for mssql.
CAST AS DATETIMEOFFSET
mssql
import ibis ibis.mssql.connect(...).sql("SELECT CAST('2024-01-01 00:00:00' AS DATETIMEOFFSET)").to_pandas()
9.2.0
return self.connection.sql(sql).limit(limit).to_pandas() ../.venv/lib/python3.11/site-packages/ibis/backends/sql/__init__.py:203: in sql schema = self._get_schema_using_query(query) ../.venv/lib/python3.11/site-packages/ibis/backends/mssql/__init__.py:247: in _get_schema_using_query return sch.Schema(schema) ../.venv/lib/python3.11/site-packages/ibis/common/bases.py:72: in __call__ return cls.__create__(*args, **kwargs) ../.venv/lib/python3.11/site-packages/ibis/common/grounds.py:119: in __create__ kwargs = cls.__signature__.validate(cls, args, kwargs) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Signature (fields: FrozenOrderedDict[str, DataType])> func = <class 'ibis.expr.schema.Schema'> args = ({None: Timestamp(timezone='UTC', scale=7, nullable=True)},), kwargs = {} def validate(self, func, args, kwargs): """Validate the arguments against the signature. Parameters ---------- func : Callable Callable to validate the arguments for. args : tuple Positional arguments. kwargs : dict Keyword arguments. Returns ------- validated : dict Dictionary of validated arguments. """ try: bound = self.bind(*args, **kwargs) bound.apply_defaults() except TypeError as err: raise SignatureValidationError( "{call} {cause}\n\nExpected signature: {sig}", sig=self, func=func, args=args, kwargs=kwargs, ) from err this, errors = {}, [] for name, value in bound.arguments.items(): param = self.parameters[name] pattern = param.annotation.pattern result = pattern.match(value, this) if result is NoMatch: errors.append((name, value, pattern)) else: this[name] = result if errors: > raise SignatureValidationError( "{call} has failed due to the following errors:{errors}\n\nExpected signature: {sig}", sig=self, func=func, args=args, kwargs=kwargs, errors=errors, ) E ibis.common.annotations.SignatureValidationError: Schema({None: Timestamp(timezone='UTC', scale=7, nullable=True)}) has failed due to the following errors: E `fields`: {None: Timestamp(timezone='UTC', scale=7, nullable=True)} is not matching GenericMappingOf(key=InstanceOf(type=<class 'str'>), value=CoercedTo(type=<class 'ibis.expr.datatypes.core.DataType'>, func=<bound method DataType.__coerce__ of <class 'ibis.expr.datatypes.core.DataType'>>), type=CoercedTo(type=<class 'ibis.common.collections.FrozenOrderedDict'>, func=<class 'ibis.common.collections.FrozenOrderedDict'>)) E E Expected signature: Schema(fields: FrozenOrderedDict[str, DataType]) ../.venv/lib/python3.11/site-packages/ibis/common/annotations.py:497: SignatureValidationError
The text was updated successfully, but these errors were encountered:
If the statement is SELECT CAST('2024-01-01 00:00:00 -06:00' AS DATETIMEOFFSET) AS col_1 with a column name, it will be fine.
SELECT CAST('2024-01-01 00:00:00 -06:00' AS DATETIMEOFFSET) AS col_1
Sorry, something went wrong.
Glad you were able to find a workaround, but this still seems like a bug.
fix(mssql): ensure that dot-sql can be executed when column names are…
1936437
… not provided (#10028) Closes #10025.
Hi @cpcloud,
I appreciate you taking the time to fix this issue, even though I've closed the ticket. You are very kind.
Successfully merging a pull request may close this issue.
What happened?
Ibis will raise an error when I use a statement with
CAST AS DATETIMEOFFSETformssql.What version of ibis are you using?
9.2.0
What backend(s) are you using, if any?
mssql
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: