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

Catalog Error: Scalar Function with name date does not exist! in version 0.9.8 #83

Closed
Stegallo opened this issue Apr 22, 2024 · 2 comments · Fixed by #84
Closed

Catalog Error: Scalar Function with name date does not exist! in version 0.9.8 #83

Stegallo opened this issue Apr 22, 2024 · 2 comments · Fixed by #84

Comments

@Stegallo
Copy link

when using function date() in a sql script results in Catalog Error: Scalar Function with name date does not exist! in version 0.9.8.

it used to work successfully in version 0.9.6.

here's code used to replicate the issue. Works in 0.9.6. Fails in 0.9.8

import fakesnow
import snowflake.connector

conn = snowflake.connector.connect()

conn.cursor().execute('CREATE DATABASE TEST')
conn.cursor().execute('USE DATABASE TEST')
conn.cursor().execute('CREATE SCHEMA TEST')
conn.cursor().execute('USE SCHEMA TEST')
print(conn.cursor().execute("with SOURCE_TABLE AS (SELECT '2024-01-01' AS start_date) SELECT 'Hello fake world!', date(a.start_date) from SOURCE_TABLE AS a").fetchone())
@tekumara
Copy link
Owner

Thanks for raising this, looks like this was introduced when moving from sqlglot 21.2 to 23.3 👀

@tekumara
Copy link
Owner

Raised here tobymao/sqlglot#3338

tekumara pushed a commit that referenced this issue May 1, 2024
🤖 I have created a release *beep* *boop*
---


## [0.9.9](v0.9.8...v0.9.9)
(2024-05-01)


### Bug Fixes

* CREATE TABLE AS with aliases and combined fields
([dbffa01](dbffa01)),
closes [#82](#82)
* patching in fakesnow.ipynb
([388c0ef](388c0ef))


### Chores

* bump sqlglot 23.12.2
([d22facb](d22facb)),
closes [#83](#83)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: potatobot-prime[bot] <132267321+potatobot-prime[bot]@users.noreply.github.com>
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

Successfully merging a pull request may close this issue.

2 participants