o
    SD©id'  ã                   @   s,   d dl mZ d dlmZ G dd„ deƒZdS )é    )Ú
exclusions)ÚSuiteRequirementsc                   @   s¼  e Zd ZdZedd„ ƒZedd„ ƒZedd„ ƒZedd	„ ƒZed
d„ ƒZ	edd„ ƒZ
edd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZedd„ ƒZed d!„ ƒZed"d#„ ƒZed$d%„ ƒZed&d'„ ƒZed(d)„ ƒZed*d+„ ƒZed,d-„ ƒZed.d/„ ƒZed0d1„ ƒZed2d3„ ƒZed4d5„ ƒZed6d7„ ƒZed8d9„ ƒZ ed:d;„ ƒZ!ed<d=„ ƒZ"ed>d?„ ƒZ#ed@dA„ ƒZ$edBdC„ ƒZ%edDdE„ ƒZ&edFdG„ ƒZ'edHdI„ ƒZ(edJdK„ ƒZ)edLdM„ ƒZ*edNdO„ ƒZ+edPdQ„ ƒZ,edRdS„ ƒZ-edTdU„ ƒZ.edVdW„ ƒZ/edXdY„ ƒZ0edZd[„ ƒZ1ed\d]„ ƒZ2ed^d_„ ƒZ3ed`da„ ƒZ4edbdc„ ƒZ5eddde„ ƒZ6edfdg„ ƒZ7edhdi„ ƒZ8edjdk„ ƒZ9edldm„ ƒZ:edndo„ ƒZ;edpdq„ ƒZ<edrds„ ƒZ=dtS )uÚRequirementsaù  
    stay-closed properties

    1. not supported in snowflake

    - autocommit: sqlalchemy's autocommit isolation level concept does not apply to snowflake
    - isolation_level: snowflake only supports read committed
      - ref docs: https://docs.snowflake.com/en/sql-reference/transactions.html#label-txn-autocommit
                  https://docs.sqlalchemy.org/en/14/core/connections.html#setting-transaction-isolation-levels-including-dbapi-autocommit
    - index_ddl_if_exists: index not supported in snowflake
    - non_updating_cascade: updating cascade supported
    - empty_inserts: not supported in snowflake
    - full_returning: not supported in snowflake
    - insert_executemany_returning: not supported in snowflake
    - returning: not supported in snowflake
    - indexes_with_expressions: index not supported in snowflake
    - check_constraint_reflection: not supported in snowflake
    - reflect_tables_no_columns: not supported in snowflake
    - server_side_cursors: no supported in snowflake
    - index_reflects_included_columns: index not supported in snowflake
    - savepoints: not supported in snowflake
    - two_phase_transactions: not supported in snowflake
    - async_dialect: no await used
    - fetch_expression: not supported in snowflake
    - fetch_percent: not supported in snowflake
    - fetch_ties: not supported in snowflake
    - supports_distinct_on: not supported in snowflake
    - time_timezone: not supported in snowflake
    - identity_columns_standard: not supported in snowflake, snowflake does not support setting identity with min max
    - computed_columns: TODO: not supported in snowflake yet, check SNOW-169530 for virtual column
    - computed_columns_default_persisted: TODO: not supported in snowflake yet, check SNOW-169530 for virtual column
    - computed_columns_reflect_persisted: TODO: not supported in snowflake yet, check SNOW-169530 for virtual column
    - computed_columns_virtual: TODO: not supported in snowflake yet, check SNOW-169530 for virtual column
    - computed_columns_stored: TODO: not supported in snowflake yet, check SNOW-169530 for virtual column

    2. potential service side issue / unclear service behavior

    - foreign_key_constraint_option_reflection_ondelete: TODO: check service side issue or by design?
    - fk_constraint_option_reflection_ondelete_restrict: TODO: check service side issue or by design?
    - foreign_key_constraint_option_reflection_onupdate: TODO: check service side issue or by design?
    - fk_constraint_option_reflection_onupdate_restrict: TODO: check service side issue or by design?

    3. connector missing feature

    - dbapi_lastrowid: TODO, not supported in snowflake python connector, support it in the future
    - supports_lastrowid: TODO: not supported, check SNOW-11155

    4. sqlalchemy potentially missing feature
    note: not sure whether these to be supported

    - collate: TODO: order_by_collation
    - datetime_timezone: TODO: default for datetime type, snowflake uses TIMESTAMP_NTZ which
                          contains no time zone info consider creating a new column type TIMESTAMP_TZ for the
                          the time zone info
      - ref: https://docs.snowflake.com/en/sql-reference/data-types-datetime.html#timestamp-ltz-timestamp-ntz-timestamp-tz
    c                 C   ó   t  ¡ S ©N©r   Úopen©Úself© r   úZ/var/www/Datamplify/venv/lib/python3.10/site-packages/snowflake/sqlalchemy/requirements.pyÚtable_ddl_if_existsC   ó   z Requirements.table_ddl_if_existsc                 C   r   r   r   r	   r   r   r   Útable_value_constructorG   r   z$Requirements.table_value_constructorc                 C   r   r   r   r	   r   r   r   Údeferrable_fksK   r   zRequirements.deferrable_fksc                 C   r   r   r   r	   r   r   r   Úboolean_col_expressionsO   r   z$Requirements.boolean_col_expressionsc                 C   r   r   r   r	   r   r   r   ÚnullsorderingS   r   zRequirements.nullsorderingc                 C   r   r   r   r	   r   r   r   Ústandalone_bindsW   r   zRequirements.standalone_bindsc                 C   r   r   r   r	   r   r   r   Ú	intersect[   r   zRequirements.intersectc                 C   r   r   r   r	   r   r   r   Úexcept__   r   zRequirements.except_c                 C   r   r   r   r	   r   r   r   Úwindow_functionsc   r   zRequirements.window_functionsc                 C   r   r   r   r	   r   r   r   Úctesg   r   zRequirements.ctesc                 C   r   r   r   r	   r   r   r   Úctes_on_dmlk   r   zRequirements.ctes_on_dmlc                 C   r   r   r   r	   r   r   r   Útuple_ino   r   zRequirements.tuple_inc                 C   r   r   r   r	   r   r   r   Úemulated_lastrowids   r   zRequirements.emulated_lastrowidc                 C   r   r   r   r	   r   r   r   Ú&emulated_lastrowid_even_with_sequencesw   r   z3Requirements.emulated_lastrowid_even_with_sequencesc                 C   r   r   r   r	   r   r   r   Úviews{   r   zRequirements.viewsc                 C   r   r   r   r	   r   r   r   Úcross_schema_fk_reflection   r   z'Requirements.cross_schema_fk_reflectionc                 C   r   r   r   r	   r   r   r   Ú&foreign_key_constraint_name_reflectionƒ   r   z3Requirements.foreign_key_constraint_name_reflectionc                 C   r   r   r   r	   r   r   r   Úimplicit_default_schema‡   r   z$Requirements.implicit_default_schemac                 C   r   r   r   r	   r   r   r   Údefault_schema_name_switch‹   r   z'Requirements.default_schema_name_switchc                 C   r   r   r   r	   r   r   r   Úreflects_pk_names   r   zRequirements.reflects_pk_namesc                 C   r   r   r   r	   r   r   r   Úcomment_reflection“   r   zRequirements.comment_reflectionc                 C   r   r   r   r	   r   r   r   Ú1fk_constraint_option_reflection_ondelete_noaction—   r   z>Requirements.fk_constraint_option_reflection_ondelete_noactionc                 C   r   r   r   r	   r   r   r   Útemp_table_names›   r   zRequirements.temp_table_namesc                 C   r   r   r   r	   r   r   r   Útemporary_viewsŸ   r   zRequirements.temporary_viewsc                 C   r   r   r   r	   r   r   r   Úunicode_ddl£   r   zRequirements.unicode_ddlc                 C   r   r   r   r	   r   r   r   Údatetime_literals§   r   zRequirements.datetime_literalsc                 C   r   r   r   r	   r   r   r   Útimestamp_microseconds«   r   z#Requirements.timestamp_microsecondsc                 C   r   r   r   r	   r   r   r   Údatetime_historic¯   r   zRequirements.datetime_historicc                 C   r   r   r   r	   r   r   r   Údate_historic³   r   zRequirements.date_historicc                 C   r   r   r   r	   r   r   r   Ú!legacy_unconditional_json_extract·   r   z.Requirements.legacy_unconditional_json_extractc                 C   r   r   r   r	   r   r   r   Ú"precision_numerics_enotation_small»   r   z/Requirements.precision_numerics_enotation_smallc                 C   r   r   r   r	   r   r   r   Ú"precision_numerics_enotation_large¿   r   z/Requirements.precision_numerics_enotation_largec                 C   r   r   r   r	   r   r   r   Ú*precision_numerics_many_significant_digitsÃ   r   z7Requirements.precision_numerics_many_significant_digitsc                 C   r   r   r   r	   r   r   r   Ú-precision_numerics_retains_significant_digitsÇ   r   z:Requirements.precision_numerics_retains_significant_digitsc                 C   r   r   r   r	   r   r   r   Úinfinity_floatsË   r   zRequirements.infinity_floatsc                 C   r   r   r   r	   r   r   r   Úupdate_fromÏ   r   zRequirements.update_fromc                 C   r   r   r   r	   r   r   r   Údelete_fromÓ   r   zRequirements.delete_fromc                 C   r   r   r   r	   r   r   r   Úmod_operator_as_percent_sign×   r   z)Requirements.mod_operator_as_percent_signc                 C   r   r   r   r	   r   r   r   Úpercent_schema_namesÛ   r   z!Requirements.percent_schema_namesc                 C   r   r   r   r	   r   r   r   Úorder_by_label_with_expressionß   r   z+Requirements.order_by_label_with_expressionc                 C   r   r   r   r	   r   r   r   Úregexp_matchã   r   zRequirements.regexp_matchc                 C   r   r   r   r	   r   r   r   Úregexp_replaceç   r   zRequirements.regexp_replacec                 C   r   r   r   r	   r   r   r   Úfetch_firstë   r   zRequirements.fetch_firstc                 C   r   r   r   r	   r   r   r   Úfetch_no_order_byï   r   zRequirements.fetch_no_order_byc                 C   r   r   r   r	   r   r   r   Úfetch_offset_with_optionsó   r   z&Requirements.fetch_offset_with_optionsc                 C   r   r   r   r	   r   r   r   Úidentity_columns÷   r   zRequirements.identity_columnsc                 C   r   r   ©r   Úclosedr	   r   r   r   Ú$duplicate_key_raises_integrity_errorû   ó   z1Requirements.duplicate_key_raises_integrity_errorc                 C   r   r   r<   r	   r   r   r   Úctes_with_update_delete   ó   z$Requirements.ctes_with_update_deletec                 C   r   r   r<   r	   r   r   r   Úsql_expression_limit_offset  r?   z(Requirements.sql_expression_limit_offsetc                 C   r   r   r<   r	   r   r   r   Ú	json_type  rA   zRequirements.json_typec                 C   r   r   r<   r	   r   r   r   Úimplements_get_lastrowid  r?   z%Requirements.implements_get_lastrowidc                 C   r   r   r<   r	   r   r   r   Úimplicit_decimal_binds  ó   z#Requirements.implicit_decimal_bindsc                 C   r   r   r<   r	   r   r   r   Údatetime_implicit_bound  rF   z$Requirements.datetime_implicit_boundc                 C   r   r   r<   r	   r   r   r   Údate_implicit_bound$  rA   z Requirements.date_implicit_boundc                 C   r   r   r<   r	   r   r   r   Útime_implicit_bound*  rA   z Requirements.time_implicit_boundc                 C   r   r   r<   r	   r   r   r   Ú%timestamp_microseconds_implicit_bound0  rF   z2Requirements.timestamp_microseconds_implicit_boundc                 C   r   r   r<   r	   r   r   r   Ú
array_type7  r   zRequirements.array_typeN)>Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úpropertyr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r>   r@   rB   rC   rD   rE   rG   rH   rI   rJ   rK   r   r   r   r   r   	   sè    9























































r   N)Úsqlalchemy.testingr   Úsqlalchemy.testing.requirementsr   r   r   r   r   r   Ú<module>   s   