8000 RecursionError: maximum recursion depth exceeded · Issue #682 · tconbeer/sqlfmt · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

RecursionError: maximum recursion depth exceeded #682

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

Open
andreineculau opened this issue Mar 14, 2025 · 1 comment
Open

RecursionError: maximum recursion depth exceeded #682

andreineculau opened this issue Mar 14, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@andreineculau
Copy link

Describe the bug
A fairly simple SQL file with DROP statements can cause recursion errors. It looks like it's the number of statements that is the problem, not the actual statements. In the example below, you can see that truncating the file to 180 lines works, add another 20 lines, fails, keep only the 20 lines in question, works.

To Reproduce

file
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;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
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;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
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP VIEW X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP TABLE X.Y.Z;
DROP VIEW X.Y.Z;

Expected behavior
Success.

Actual behavior

output excerpt
 File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/sqlfmt/actions.py", line 342, in handle_reserved_keyword
    action(analyzer, source_string, match)
    ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/sqlfmt/actions.py", line 383, in lex_ruleset
    analyzer.lex(source_string)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/sqlfmt/analyzer.py", line 158, in lex
    self.lex_one(source_string)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/sqlfmt/analyzer.py", line 133, in lex_one
    rule.action(self, source_string, match)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/sqlfmt/actions.py", line 367, in handle_nonreserved_top_level_keyword
    handle_reserved_keyword(
    ~~~~~~~~~~~~~~~~~~~~~~~^
        analyzer=analyzer, source_string=source_string, match=match, action=action
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/sqlfmt/actions.py", line 342, in handle_reserved_keyword
    action(analyzer, source_string, match)
    ~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/sqlfmt/actions.py", line 383, in lex_ruleset
    analyzer.lex(source_string)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/sqlfmt/analyzer.py", line 158, in lex
    self.lex_one(source_string)
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/sqlfmt/analyzer.py", line 133, in lex_one
    rule.action(self, source_string, match)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/sqlfmt/actions.py", line 326, in handle_reserved_keyword
    if analyzer.previous_node is None:
       ^^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/linuxbrew/.local/bin/sqlfmt", line 8, in
sys.exit(sqlfmt())
~~~~~~^^
File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/click/core.py", line 1161, in call
return self.main(*args, **kwargs)
~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/sqlfmt/cli.py", line 190, in sqlfmt
report = api.run(files=matched_files, mode=mode, callback=progress_callback)
File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/sqlfmt/api.py", line 79, in run
results = _format_many(files, cache, mode, callback=callback)
File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/sqlfmt/api.py", line 200, in _format_many
asyncio.run(_multiprocess_map(format_func, paths, callback=callback))
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/linuxbrew/.linuxbrew/opt/python@3.13/lib/python3.13/asyncio/runners.py", line 195, in run
return runner.run(main)
~~~~~~~~~~^^^^^^
File "/home/linuxbrew/.linuxbrew/opt/python@3.13/lib/python3.13/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/home/linuxbrew/.linuxbrew/opt/python@3.13/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
return future.result()
~~~~~~~~~~~~~^^
File "/home/linuxbrew/.local/share/pipx/venvs/shandy-sqlfmt/lib/python3.13/site-packages/sqlfmt/api.py", line 228, in _multiprocess_map
results: List[R] = await asyncio.gather(*tasks)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded

Additional context
What is the output of sqlfmt --version?

sqlfmt, version 0.26.0

What is the output of pip list (or pipx list if you installed using pipx)?

n/a

@tconbeer tconbeer added the bug Something isn't working label Mar 17, 2025
@nevdelap
Copy link
nevdelap commented Mar 21, 2025

👋 I have the same issue. So just in case it helps, here is another example to test with. Uncommenting any of the GRANTs in the block of commented out grants in the middle causes the issue.

> sqlfmt --version
sqlfmt, version 0.26.0
>
Formattable SQL, until one of the commented out GRANTs is uncommented.
create warehouse redacted
auto_resume = true
auto_suspend = 1
comment = 'redacted'
enable_query_acceleration = false  -- noqa: PRS
max_cluster_count = 1
min_cluster_count = 1
query_acceleration_max_scale_factor = 8
scaling_policy = 'STANDARD'
warehouse_size = 'X-Small'
warehouse_type = 'STANDARD'
;

CREATE NETWORK POLICY redacted
ALLOWED_IP_LIST = (
  '0.0.0.0'
  , '0.0.0.0'
  , '0.0.0.0'
)
COMMENT = 'redacted';

CREATE USER redacted
COMMENT = NULL
DEFAULT_ROLE = 'redacted'
DEFAULT_WAREHOUSE = 'redacted'
DISABLED = FALSE
DISPLAY_NAME = 'redacted'
EMAIL = NULL
FIRST_NAME = NULL
LAST_NAME = NULL
LOGIN_NAME = 'redacted'
NETWORK_POLICY = 'redacted'
TIMESTAMP_TYPE_MAPPING = 'TIMESTAMP_TZ';

CREATE ROLE redacted
COMMENT = 'redacted';

grant role redacted
to user redacted
;

grant add search optimization
on schema redacted
to role redacted
;
grant add search optimization
on schema redacted
to role redacted
;
grant add search optimization
on schema redacted
to role redacted
;
grant applybudget
on schema redacted
to role redacted
;
grant applybudget
on schema redacted
to role redacted
;
grant applybudget
on schema redacted
to role redacted
;
grant create aggregation policy
on schema redacted
to role redacted
;
grant create aggregation policy
on schema redacted
to role redacted
;
grant create aggregation policy
on schema redacted
to role redacted
;
grant create alert
on schema redacted
to role redacted
;
grant create alert
on schema redacted
to role redacted
;
grant create alert
on schema redacted
to role redacted
;
grant create authentication policy
on schema redacted
to role redacted
;
grant create authentication policy
on schema redacted
to role redacted
;
grant create authentication policy
on schema redacted
to role redacted
;
grant create contact
on schema redacted
to role redacted
;
grant create contact
on schema redacted
to role redacted
;
grant create contact
on schema redacted
to role redacted
;
grant create cortex search service
on schema redacted
to role redacted
;
grant create cortex search service
on schema redacted
to role redacted
;
grant create cortex search service
on schema redacted
to role redacted
;
grant create data metric function
on schema redacted
to role redacted
;
grant create data metric function
on schema redacted
to role redacted
;
grant create data metric function
on schema redacted
to role redacted
;
grant create dataset
on schema redacted
to role redacted
;
grant create dataset
on schema redacted
to role redacted
;
grant create dataset
on schema redacted
to role redacted
;
grant create dynamic table
on schema redacted
to role redacted
;
grant create dynamic table
on schema redacted
to role redacted
;
grant create dynamic table
on schema redacted
to role redacted
;
grant create event table
on schema redacted
to role redacted
;
grant create event table
on schema redacted
to role redacted
;
grant create event table
on schema redacted
to role redacted
;
grant create external table
on schema redacted
to role redacted
;
grant create external table
on schema redacted
to role redacted
;
grant create external table
on schema redacted
to role redacted
;
grant create file format
on schema redacted
to role redacted
;
grant create file format
on schema redacted
to role redacted
;
grant create file format
on schema redacted
to role redacted
;
grant create function
on schema redacted
to role redacted
;
grant create function
on schema redacted
to role redacted
;
grant create function
on schema redacted
to role redacted
;
grant create git repository
on schema redacted
to role redacted
;
grant create git repository
on schema redacted
to role redacted
;
grant create git repository
on schema redacted
to role redacted
;
grant create iceberg table
on schema redacted
to role redacted
;
grant create iceberg table
on schema redacted
to role redacted
;
grant create iceberg table
on schema redacted
to role redacted
;
grant create image repository
on schema redacted
to role redacted
;
grant create image repository
on schema redacted
to role redacted
;
grant create image repository
on schema redacted
to role redacted
;
grant create integration
on account
to role redacted
;
grant create join policy
on schema redacted
to role redacted
;
grant create join policy
on schema redacted
to role redacted
;
grant create join policy
on schema redacted
to role redacted
;
grant create masking policy
on schema redacted
to role redacted
;
grant create masking policy
on schema redacted
to role redacted
;
grant create masking policy
on schema redacted
to role redacted
;
grant create materialized view
on schema redacted
to role redacted
;
grant create materialized view
on schema redacted
to role redacted
;
grant create materialized view
on schema redacted
to role redacted
;
grant create model monitor
on schema redacted
to role redacted
;
grant create model monitor
on schema redacted
to role redacted
;
grant create model monitor
on schema redacted
to role redacted
;
grant create model
on schema redacted
to role redacted
;
grant create model
on schema redacted
to role redacted
;
grant create model
on schema redacted
to role redacted
;
grant create network rule
on schema redacted
to role redacted
;
grant create network rule
on schema redacted
to role redacted
;
grant create network rule
on schema redacted
to role redacted
;
grant create notebook
on schema redacted
to role redacted
;
grant create notebook
on schema redacted
to role redacted
;
grant create notebook
on schema redacted
to role redacted
;
grant create packages policy
on schema redacted
to role redacted
;
grant create packages policy
on schema redacted
to role redacted
;
grant create packages policy
on schema redacted
to role redacted
;
grant create password policy
on schema redacted
to role redacted
;
grant create password policy
on schema redacted
to role redacted
;
grant create password policy
on schema redacted
to role redacted
;
grant create pipe
on schema redacted
to role redacted
;
-- GRANT CREATE PIPE ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE PIPE ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE PRIVACY POLICY ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE PRIVACY POLICY ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE PRIVACY POLICY ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE PROCEDURE ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE PROCEDURE ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE PROCEDURE ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE PROJECTION POLICY ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE PROJECTION POLICY ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE PROJECTION POLICY ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE RESOURCE GROUP ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE RESOURCE GROUP ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE RESOURCE GROUP ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE ROW ACCESS POLICY ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE ROW ACCESS POLICY ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE ROW ACCESS POLICY ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE SCHEMA ON DATABASE ingest_flow TO ROLE redacted;
-- GRANT CREATE SECRET ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE SECRET ON SCHEMA redacted TO ROLE redacted;
-- GRANT CREATE SECRET ON SCHEMA redacted TO ROLE redacted;
-- This seems to be something Snowflake can do itself when manipulated through
-- the Web interface or by doing a GRANT ALL but that doesn't yet exist as GRANT
-- SEMANTIC VIEW in SQL.
-- grant create semantic view
-- on schema redacted
-- to role redacted
-- ;
grant create semantic view
on schema redacted
to role redacted
;
grant create semantic view
on schema redacted
to role redacted
;
grant create sequence
on schema redacted
to role redacted
;
grant create sequence
on schema redacted
to role redacted
;
grant create sequence
on schema redacted
to role redacted
;
grant create service class
on schema redacted
to role redacted
;
grant create service class
on schema redacted
to role redacted
;
grant create service class
on schema redacted
to role redacted
;
grant create service
on schema redacted
to role redacted
;
grant create service
on schema redacted
to role redacted
;
grant create service
on schema redacted
to role redacted
;
grant create session policy
on schema redacted
to role redacted
;
grant create session policy
on schema redacted
to role redacted
;
grant create session policy
on schema redacted
to role redacted
;
grant create snapshot
on schema redacted
to role redacted
;
grant create snapshot
on schema redacted
to role redacted
;
grant create snapshot
on schema redacted
to role redacted
;
grant create stage
on schema redacted
to role redacted
;
grant create stage
on schema redacted
to role redacted
;
grant create stage
on schema redacted
to role redacted
;
grant create stream
on schema redacted
to role redacted
;
grant create stream
on schema redacted
to role redacted
;
grant create stream
on schema redacted
to role redacted
;
grant create streamlit
on schema redacted
to role redacted
;
grant create streamlit
on schema redacted
to role redacted
;
grant create streamlit
on schema redacted
to role redacted
;
grant create table
on schema redacted
to role redacted
;
grant create table
on schema redacted
to role redacted
;
grant create table
on schema redacted
to role redacted
;
grant create tag
on schema redacted
to role redacted
;
grant create tag
on schema redacted
to role redacted
;
grant create tag
on schema redacted
to role redacted
;
grant create task
on schema redacted
to role redacted
;
grant create task
on schema redacted
to role redacted
;
grant create task
on schema redacted
to role redacted
;
grant create temporary table
on schema redacted
to role redacted
;
grant create temporary table
on schema redacted
to role redacted
;
grant create temporary table
on schema redacted
to role redacted
;
grant create view
on schema redacted
to role redacted
;
grant create view
on schema redacted
to role redacted
;
grant create view
on schema redacted
to role redacted
;
grant modify
on schema redacted
to role redacted
;
grant modify
on schema redacted
to role redacted
;
grant modify
on schema redacted
to role redacted
;
grant monitor
on database ingest_flow
to role redacted
;
grant monitor
on schema redacted
to role redacted
;
grant monitor
on schema redacted
to role redacted
;
grant monitor
on schema redacted
to role redacted
;
grant usage
on database ingest_flow
to role redacted
;
grant usage
on schema redacted
to role redacted
;
grant usage
on schema redacted
to role redacted
;
grant usage
on schema redacted
to role redacted
;
grant usage
on warehouse redacted
to role redacted
;

ALTER USER redacted
SET
DEFAULT_ROLE = 'redacted';

Result
Traceback (most recent call last):
File "/home/nevd/miniconda3/envs/snowflake/bin/sqlfmt", line 10, in <module>
  sys.exit(sqlfmt())
           ^^^^^^^^
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/click/core.py", line 1161, in __call__
  return self.main(*args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/click/core.py", line 1082, in main
  rv = self.invoke(ctx)
       ^^^^^^^^^^^^^^^^
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/click/core.py", line 1443, in invoke
  return ctx.invoke(self.callback, **ctx.params)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/click/core.py", line 788, in invoke
  return __callback(*args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
  return f(get_current_context(), *args, **kwargs)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/cli.py", line 190, in sqlfmt
  report = api.run(files=matched_files, mode=mode, callback=progress_callback)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/api.py", line 79, in run
  results = _format_many(files, cache, mode, callback=callback)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/api.py", line 203, in _format_many
  results.extend((map(format_func, cache_misses)))
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/api.py", line 239, in _format_one
  formatted = format_string(source, mode)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/api.py", line 46, in format_string
  raw_query = analyzer.parse_query(source_string=source_string)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/analyzer.py", line 100, in parse_query
  self.lex(source_string=source_string)
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/analyzer.py", line 158, in lex
  self.lex_one(source_string)
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/analyzer.py", line 133, in lex_one
  rule.action(self, source_string, match)
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/actions.py", line 367, in handle_nonreserved_top_level_keyword
  handle_reserved_keyword(
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11
65AD
/site-packages/sqlfmt/actions.py", line 327, in handle_reserved_keyword
...
...
...
...
...
  action(analyzer, source_string, match)
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/actions.py", line 383, in lex_ruleset
  analyzer.lex(source_string)
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/analyzer.py", line 158, in lex
  self.lex_one(source_string)
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/analyzer.py", line 133, in lex_one
  rule.action(self, source_string, match)
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/actions.py", line 367, in handle_nonreserved_top_level_keyword
  handle_reserved_keyword(
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/actions.py", line 342, in handle_reserved_keyword
  action(analyzer, source_string, match)
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/actions.py", line 383, in lex_ruleset
  analyzer.lex(source_string)
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/analyzer.py", line 158, in lex
  self.lex_one(source_string)
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/analyzer.py", line 133, in lex_one
  rule.action(self, source_string, match)
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/actions.py", line 326, in handle_reserved_keyword
  if analyzer.previous_node is None:
     ^^^^^^^^^^^^^^^^^^^^^^
File "/home/nevd/miniconda3/envs/snowflake/lib/python3.11/site-packages/sqlfmt/analyzer.py", line 40, in previous_node
  return self.previous_line_node
         ^^^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
0