snowpark-connect 0.20.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of snowpark-connect might be problematic. Click here for more details.
- snowflake/snowpark_connect/__init__.py +23 -0
- snowflake/snowpark_connect/analyze_plan/__init__.py +3 -0
- snowflake/snowpark_connect/analyze_plan/map_tree_string.py +38 -0
- snowflake/snowpark_connect/column_name_handler.py +735 -0
- snowflake/snowpark_connect/config.py +576 -0
- snowflake/snowpark_connect/constants.py +47 -0
- snowflake/snowpark_connect/control_server.py +52 -0
- snowflake/snowpark_connect/dataframe_name_handler.py +54 -0
- snowflake/snowpark_connect/date_time_format_mapping.py +399 -0
- snowflake/snowpark_connect/empty_dataframe.py +18 -0
- snowflake/snowpark_connect/error/__init__.py +11 -0
- snowflake/snowpark_connect/error/error_mapping.py +6174 -0
- snowflake/snowpark_connect/error/error_utils.py +321 -0
- snowflake/snowpark_connect/error/exceptions.py +24 -0
- snowflake/snowpark_connect/execute_plan/__init__.py +3 -0
- snowflake/snowpark_connect/execute_plan/map_execution_command.py +204 -0
- snowflake/snowpark_connect/execute_plan/map_execution_root.py +173 -0
- snowflake/snowpark_connect/execute_plan/utils.py +183 -0
- snowflake/snowpark_connect/expression/__init__.py +3 -0
- snowflake/snowpark_connect/expression/literal.py +90 -0
- snowflake/snowpark_connect/expression/map_cast.py +343 -0
- snowflake/snowpark_connect/expression/map_expression.py +293 -0
- snowflake/snowpark_connect/expression/map_extension.py +104 -0
- snowflake/snowpark_connect/expression/map_sql_expression.py +633 -0
- snowflake/snowpark_connect/expression/map_udf.py +142 -0
- snowflake/snowpark_connect/expression/map_unresolved_attribute.py +241 -0
- snowflake/snowpark_connect/expression/map_unresolved_extract_value.py +85 -0
- snowflake/snowpark_connect/expression/map_unresolved_function.py +9450 -0
- snowflake/snowpark_connect/expression/map_unresolved_star.py +218 -0
- snowflake/snowpark_connect/expression/map_update_fields.py +164 -0
- snowflake/snowpark_connect/expression/map_window_function.py +258 -0
- snowflake/snowpark_connect/expression/typer.py +125 -0
- snowflake/snowpark_connect/includes/__init__.py +0 -0
- snowflake/snowpark_connect/includes/jars/antlr4-runtime-4.9.3.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-cli-1.5.0.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-codec-1.16.1.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-collections-3.2.2.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-collections4-4.4.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-compiler-3.1.9.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-compress-1.26.0.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-crypto-1.1.0.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-dbcp-1.4.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-io-2.16.1.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-lang-2.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-lang3-3.12.0.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-logging-1.1.3.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-math3-3.6.1.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-pool-1.5.4.jar +0 -0
- snowflake/snowpark_connect/includes/jars/commons-text-1.10.0.jar +0 -0
- snowflake/snowpark_connect/includes/jars/hadoop-client-api-3.3.4.jar +0 -0
- snowflake/snowpark_connect/includes/jars/jackson-annotations-2.15.2.jar +0 -0
- snowflake/snowpark_connect/includes/jars/jackson-core-2.15.2.jar +0 -0
- snowflake/snowpark_connect/includes/jars/jackson-core-asl-1.9.13.jar +0 -0
- snowflake/snowpark_connect/includes/jars/jackson-databind-2.15.2.jar +0 -0
- snowflake/snowpark_connect/includes/jars/jackson-dataformat-yaml-2.15.2.jar +0 -0
- snowflake/snowpark_connect/includes/jars/jackson-datatype-jsr310-2.15.2.jar +0 -0
- snowflake/snowpark_connect/includes/jars/jackson-mapper-asl-1.9.13.jar +0 -0
- snowflake/snowpark_connect/includes/jars/jackson-module-scala_2.12-2.15.2.jar +0 -0
- snowflake/snowpark_connect/includes/jars/json4s-ast_2.12-3.7.0-M11.jar +0 -0
- snowflake/snowpark_connect/includes/jars/json4s-core_2.12-3.7.0-M11.jar +0 -0
- snowflake/snowpark_connect/includes/jars/json4s-jackson_2.12-3.7.0-M11.jar +0 -0
- snowflake/snowpark_connect/includes/jars/json4s-scalap_2.12-3.7.0-M11.jar +0 -0
- snowflake/snowpark_connect/includes/jars/kryo-shaded-4.0.2.jar +0 -0
- snowflake/snowpark_connect/includes/jars/log4j-1.2-api-2.20.0.jar +0 -0
- snowflake/snowpark_connect/includes/jars/log4j-api-2.20.0.jar +0 -0
- snowflake/snowpark_connect/includes/jars/log4j-core-2.20.0.jar +0 -0
- snowflake/snowpark_connect/includes/jars/log4j-slf4j2-impl-2.20.0.jar +0 -0
- snowflake/snowpark_connect/includes/jars/paranamer-2.8.jar +0 -0
- snowflake/snowpark_connect/includes/jars/scala-collection-compat_2.12-2.7.0.jar +0 -0
- snowflake/snowpark_connect/includes/jars/scala-compiler-2.12.18.jar +0 -0
- snowflake/snowpark_connect/includes/jars/scala-library-2.12.18.jar +0 -0
- snowflake/snowpark_connect/includes/jars/scala-parser-combinators_2.12-2.3.0.jar +0 -0
- snowflake/snowpark_connect/includes/jars/scala-reflect-2.12.18.jar +0 -0
- snowflake/snowpark_connect/includes/jars/scala-xml_2.12-2.1.0.jar +0 -0
- snowflake/snowpark_connect/includes/jars/slf4j-api-2.0.7.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-catalyst_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-common-utils_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-core_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-graphx_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-hive-thriftserver_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-hive_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-kubernetes_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-kvstore_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-launcher_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-mesos_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-mllib-local_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-mllib_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-network-common_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-network-shuffle_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-repl_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-sketch_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-sql-api_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-sql_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-streaming_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-tags_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-unsafe_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-yarn_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/python/__init__.py +21 -0
- snowflake/snowpark_connect/includes/python/pyspark/__init__.py +173 -0
- snowflake/snowpark_connect/includes/python/pyspark/_globals.py +71 -0
- snowflake/snowpark_connect/includes/python/pyspark/_typing.pyi +43 -0
- snowflake/snowpark_connect/includes/python/pyspark/accumulators.py +341 -0
- snowflake/snowpark_connect/includes/python/pyspark/broadcast.py +383 -0
- snowflake/snowpark_connect/includes/python/pyspark/cloudpickle/__init__.py +8 -0
- snowflake/snowpark_connect/includes/python/pyspark/cloudpickle/cloudpickle.py +948 -0
- snowflake/snowpark_connect/includes/python/pyspark/cloudpickle/cloudpickle_fast.py +844 -0
- snowflake/snowpark_connect/includes/python/pyspark/cloudpickle/compat.py +18 -0
- snowflake/snowpark_connect/includes/python/pyspark/conf.py +276 -0
- snowflake/snowpark_connect/includes/python/pyspark/context.py +2601 -0
- snowflake/snowpark_connect/includes/python/pyspark/daemon.py +218 -0
- snowflake/snowpark_connect/includes/python/pyspark/errors/__init__.py +70 -0
- snowflake/snowpark_connect/includes/python/pyspark/errors/error_classes.py +889 -0
- snowflake/snowpark_connect/includes/python/pyspark/errors/exceptions/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/errors/exceptions/base.py +228 -0
- snowflake/snowpark_connect/includes/python/pyspark/errors/exceptions/captured.py +307 -0
- snowflake/snowpark_connect/includes/python/pyspark/errors/exceptions/connect.py +190 -0
- snowflake/snowpark_connect/includes/python/pyspark/errors/tests/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/errors/tests/test_errors.py +60 -0
- snowflake/snowpark_connect/includes/python/pyspark/errors/utils.py +116 -0
- snowflake/snowpark_connect/includes/python/pyspark/files.py +165 -0
- snowflake/snowpark_connect/includes/python/pyspark/find_spark_home.py +95 -0
- snowflake/snowpark_connect/includes/python/pyspark/install.py +203 -0
- snowflake/snowpark_connect/includes/python/pyspark/instrumentation_utils.py +190 -0
- snowflake/snowpark_connect/includes/python/pyspark/java_gateway.py +248 -0
- snowflake/snowpark_connect/includes/python/pyspark/join.py +118 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/__init__.py +71 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/_typing.pyi +84 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/base.py +414 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/classification.py +4332 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/clustering.py +2188 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/common.py +146 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/connect/__init__.py +44 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/connect/base.py +346 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/connect/classification.py +382 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/connect/evaluation.py +291 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/connect/feature.py +258 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/connect/functions.py +77 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/connect/io_utils.py +335 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/connect/pipeline.py +262 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/connect/summarizer.py +120 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/connect/tuning.py +579 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/connect/util.py +173 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/deepspeed/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/deepspeed/deepspeed_distributor.py +165 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/deepspeed/tests/test_deepspeed_distributor.py +306 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/dl_util.py +150 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/evaluation.py +1166 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/feature.py +7474 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/fpm.py +543 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/functions.py +842 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/image.py +271 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/linalg/__init__.py +1382 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/model_cache.py +55 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/param/__init__.py +602 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/param/_shared_params_code_gen.py +368 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/param/shared.py +878 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/pipeline.py +451 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/recommendation.py +748 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/regression.py +3335 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/stat.py +523 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_connect_classification.py +53 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_connect_evaluation.py +50 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_connect_feature.py +43 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_connect_function.py +114 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_connect_pipeline.py +47 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_connect_summarizer.py +43 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_connect_tuning.py +46 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_legacy_mode_classification.py +238 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_legacy_mode_evaluation.py +194 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_legacy_mode_feature.py +156 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_legacy_mode_pipeline.py +184 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_legacy_mode_summarizer.py +78 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_legacy_mode_tuning.py +292 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_parity_torch_data_loader.py +50 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_parity_torch_distributor.py +152 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_algorithms.py +456 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_base.py +96 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_dl_util.py +186 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_evaluation.py +77 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_feature.py +401 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_functions.py +528 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_image.py +82 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_linalg.py +409 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_model_cache.py +55 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_param.py +441 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_persistence.py +546 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_pipeline.py +71 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_stat.py +52 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_training_summary.py +494 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_util.py +85 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_wrapper.py +138 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/test_cv_io_basic.py +151 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/test_cv_io_nested.py +97 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/test_cv_io_pipeline.py +143 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/test_tuning.py +551 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/test_tvs_io_basic.py +137 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/test_tvs_io_nested.py +96 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/test_tvs_io_pipeline.py +142 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/torch/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/torch/data.py +100 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/torch/distributor.py +1133 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/torch/log_communication.py +198 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/torch/tests/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/torch/tests/test_data_loader.py +137 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/torch/tests/test_distributor.py +561 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/torch/tests/test_log_communication.py +172 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/torch/torch_run_process_wrapper.py +83 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tree.py +434 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/tuning.py +1741 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/util.py +749 -0
- snowflake/snowpark_connect/includes/python/pyspark/ml/wrapper.py +465 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/__init__.py +44 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/_typing.pyi +33 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/classification.py +989 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/clustering.py +1318 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/common.py +174 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/evaluation.py +691 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/feature.py +1085 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/fpm.py +233 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/linalg/__init__.py +1653 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/linalg/distributed.py +1662 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/random.py +698 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/recommendation.py +389 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/regression.py +1067 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/stat/KernelDensity.py +59 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/stat/__init__.py +34 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/stat/_statistics.py +409 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/stat/distribution.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/stat/test.py +86 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tests/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tests/test_algorithms.py +353 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tests/test_feature.py +192 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tests/test_linalg.py +680 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tests/test_stat.py +206 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tests/test_streaming_algorithms.py +471 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tests/test_util.py +108 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tree.py +888 -0
- snowflake/snowpark_connect/includes/python/pyspark/mllib/util.py +659 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/__init__.py +165 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/_typing.py +52 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/accessors.py +989 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/base.py +1804 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/categorical.py +822 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/config.py +539 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/correlation.py +262 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/data_type_ops/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/data_type_ops/base.py +519 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/data_type_ops/binary_ops.py +98 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/data_type_ops/boolean_ops.py +426 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/data_type_ops/categorical_ops.py +141 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/data_type_ops/complex_ops.py +145 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/data_type_ops/date_ops.py +127 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/data_type_ops/datetime_ops.py +171 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/data_type_ops/null_ops.py +83 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/data_type_ops/num_ops.py +588 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/data_type_ops/string_ops.py +154 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/data_type_ops/timedelta_ops.py +101 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/data_type_ops/udt_ops.py +29 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/datetimes.py +891 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/exceptions.py +150 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/extensions.py +388 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/frame.py +13738 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/generic.py +3560 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/groupby.py +4448 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/indexes/__init__.py +21 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/indexes/base.py +2783 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/indexes/category.py +773 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/indexes/datetimes.py +843 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/indexes/multi.py +1323 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/indexes/numeric.py +210 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/indexes/timedelta.py +197 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/indexing.py +1862 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/internal.py +1680 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/missing/__init__.py +48 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/missing/common.py +76 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/missing/frame.py +63 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/missing/general_functions.py +43 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/missing/groupby.py +93 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/missing/indexes.py +184 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/missing/resample.py +101 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/missing/scalars.py +29 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/missing/series.py +69 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/missing/window.py +168 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/mlflow.py +238 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/namespace.py +3807 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/numpy_compat.py +260 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/plot/__init__.py +17 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/plot/core.py +1213 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/plot/matplotlib.py +928 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/plot/plotly.py +261 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/resample.py +816 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/series.py +7440 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/sql_formatter.py +308 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/sql_processor.py +394 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/strings.py +2371 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/supported_api_gen.py +378 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_any_all.py +177 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_apply_func.py +575 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_binary_ops.py +235 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_combine.py +653 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_compute.py +463 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_corrwith.py +86 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_cov.py +151 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_cumulative.py +139 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_describe.py +458 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_eval.py +86 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_melt.py +202 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_missing_data.py +520 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_pivot.py +361 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_any_all.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_apply_func.py +42 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_binary_ops.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_combine.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_compute.py +60 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_corrwith.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_cov.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_cumulative.py +90 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_describe.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_eval.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_melt.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_missing_data.py +42 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_pivot.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_base.py +36 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_binary_ops.py +42 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_boolean_ops.py +47 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_categorical_ops.py +55 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_complex_ops.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_date_ops.py +47 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_datetime_ops.py +47 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_null_ops.py +42 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_num_arithmetic.py +43 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_num_ops.py +47 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_num_reverse.py +43 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_string_ops.py +47 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_timedelta_ops.py +47 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_udt_ops.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/testing_utils.py +226 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_align.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_basic_slow.py +55 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_cov_corrwith.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_dot_frame.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_dot_series.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_index.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_series.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_setitem_frame.py +43 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_setitem_series.py +43 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_attrs.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_constructor.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_conversion.py +42 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_reindexing.py +42 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_reshaping.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_spark.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_take.py +42 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_time_series.py +48 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_truncate.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_aggregate.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_apply_func.py +41 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_cumulative.py +67 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_describe.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_groupby.py +55 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_head_tail.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_index.py +38 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_missing_data.py +55 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_split_apply.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_stat.py +38 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_align.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_base.py +50 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_category.py +73 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_datetime.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_indexing.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_reindex.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_rename.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_reset_index.py +48 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_timedelta.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/io/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/io/test_parity_io.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/plot/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/plot/test_parity_frame_plot.py +45 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/plot/test_parity_frame_plot_matplotlib.py +45 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/plot/test_parity_frame_plot_plotly.py +49 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/plot/test_parity_series_plot.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/plot/test_parity_series_plot_matplotlib.py +53 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/plot/test_parity_series_plot_plotly.py +45 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_all_any.py +38 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_arg_ops.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_as_of.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_as_type.py +38 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_compute.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_conversion.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_cumulative.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_index.py +38 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_missing_data.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_series.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_sort.py +38 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_stat.py +38 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_categorical.py +66 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_config.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_csv.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_dataframe_conversion.py +42 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_dataframe_spark_io.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_default_index.py +49 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_ewm.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_expanding.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_extension.py +49 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_frame_spark.py +53 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_generic_functions.py +43 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_indexing.py +49 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_indexops_spark.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_internal.py +41 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_namespace.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_numpy_compat.py +60 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_ops_on_diff_frames.py +48 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_ops_on_diff_frames_groupby.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_ops_on_diff_frames_groupby_expanding.py +44 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_ops_on_diff_frames_groupby_rolling.py +84 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_repr.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_resample.py +45 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_reshape.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_rolling.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_scalars.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_series_conversion.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_series_datetime.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_series_string.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_spark_functions.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_sql.py +43 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_stats.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_typedef.py +36 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_utils.py +37 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_window.py +39 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_base.py +107 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_binary_ops.py +224 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_boolean_ops.py +825 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_categorical_ops.py +562 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_complex_ops.py +368 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_date_ops.py +257 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_datetime_ops.py +260 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_null_ops.py +178 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_num_arithmetic.py +184 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_num_ops.py +497 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_num_reverse.py +140 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_string_ops.py +354 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_timedelta_ops.py +219 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_udt_ops.py +192 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/testing_utils.py +228 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_align.py +118 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_basic_slow.py +198 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_cov_corrwith.py +181 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_dot_frame.py +103 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_dot_series.py +141 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_index.py +109 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_series.py +136 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_setitem_frame.py +125 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_setitem_series.py +217 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_attrs.py +384 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_constructor.py +598 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_conversion.py +73 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_reindexing.py +869 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_reshaping.py +487 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_spark.py +309 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_take.py +156 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_time_series.py +149 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_truncate.py +163 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_aggregate.py +311 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_apply_func.py +524 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_cumulative.py +419 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_describe.py +144 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_groupby.py +979 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_head_tail.py +234 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_index.py +206 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_missing_data.py +421 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_split_apply.py +187 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_stat.py +397 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_align.py +100 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_base.py +2743 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_category.py +484 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_datetime.py +276 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_indexing.py +432 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_reindex.py +310 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_rename.py +257 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_reset_index.py +160 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_timedelta.py +128 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/io/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/io/test_io.py +137 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/plot/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/plot/test_frame_plot.py +170 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/plot/test_frame_plot_matplotlib.py +547 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/plot/test_frame_plot_plotly.py +285 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/plot/test_series_plot.py +106 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/plot/test_series_plot_matplotlib.py +409 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/plot/test_series_plot_plotly.py +247 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_all_any.py +105 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_arg_ops.py +197 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_as_of.py +137 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_as_type.py +227 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_compute.py +634 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_conversion.py +88 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_cumulative.py +139 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_index.py +475 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_missing_data.py +265 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_series.py +818 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_sort.py +162 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_stat.py +780 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_categorical.py +741 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_config.py +160 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_csv.py +453 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_dataframe_conversion.py +281 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_dataframe_spark_io.py +487 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_default_index.py +109 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_ewm.py +434 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_expanding.py +253 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_extension.py +152 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_frame_spark.py +162 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_generic_functions.py +234 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_indexing.py +1339 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_indexops_spark.py +82 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_internal.py +124 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_namespace.py +638 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_numpy_compat.py +200 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_ops_on_diff_frames.py +1355 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_ops_on_diff_frames_groupby.py +655 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_ops_on_diff_frames_groupby_expanding.py +113 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_ops_on_diff_frames_groupby_rolling.py +118 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_repr.py +192 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_resample.py +346 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_reshape.py +495 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_rolling.py +263 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_scalars.py +59 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_series_conversion.py +85 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_series_datetime.py +364 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_series_string.py +362 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_spark_functions.py +46 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_sql.py +123 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_stats.py +581 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_typedef.py +447 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_utils.py +301 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_window.py +465 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/typedef/__init__.py +18 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/typedef/typehints.py +874 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/usage_logging/__init__.py +143 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/usage_logging/usage_logger.py +132 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/utils.py +1063 -0
- snowflake/snowpark_connect/includes/python/pyspark/pandas/window.py +2702 -0
- snowflake/snowpark_connect/includes/python/pyspark/profiler.py +489 -0
- snowflake/snowpark_connect/includes/python/pyspark/py.typed +1 -0
- snowflake/snowpark_connect/includes/python/pyspark/python/pyspark/shell.py +123 -0
- snowflake/snowpark_connect/includes/python/pyspark/rdd.py +5518 -0
- snowflake/snowpark_connect/includes/python/pyspark/rddsampler.py +115 -0
- snowflake/snowpark_connect/includes/python/pyspark/resource/__init__.py +38 -0
- snowflake/snowpark_connect/includes/python/pyspark/resource/information.py +69 -0
- snowflake/snowpark_connect/includes/python/pyspark/resource/profile.py +317 -0
- snowflake/snowpark_connect/includes/python/pyspark/resource/requests.py +539 -0
- snowflake/snowpark_connect/includes/python/pyspark/resource/tests/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/resource/tests/test_resources.py +83 -0
- snowflake/snowpark_connect/includes/python/pyspark/resultiterable.py +45 -0
- snowflake/snowpark_connect/includes/python/pyspark/serializers.py +681 -0
- snowflake/snowpark_connect/includes/python/pyspark/shell.py +123 -0
- snowflake/snowpark_connect/includes/python/pyspark/shuffle.py +854 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/__init__.py +75 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/_typing.pyi +80 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/avro/__init__.py +18 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/avro/functions.py +188 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/catalog.py +1270 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/column.py +1431 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/conf.py +99 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/__init__.py +18 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/_typing.py +90 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/avro/__init__.py +18 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/avro/functions.py +107 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/catalog.py +356 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/client/__init__.py +22 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/client/artifact.py +412 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/client/core.py +1689 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/client/reattach.py +340 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/column.py +514 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/conf.py +128 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/conversion.py +490 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/dataframe.py +2172 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/expressions.py +1056 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/functions.py +3937 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/group.py +418 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/plan.py +2289 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/__init__.py +25 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/base_pb2.py +203 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/base_pb2.pyi +2718 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/base_pb2_grpc.py +423 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/catalog_pb2.py +109 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/catalog_pb2.pyi +1130 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/commands_pb2.py +141 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/commands_pb2.pyi +1766 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/common_pb2.py +47 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/common_pb2.pyi +123 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/example_plugins_pb2.py +53 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/example_plugins_pb2.pyi +112 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/expressions_pb2.py +107 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/expressions_pb2.pyi +1507 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/relations_pb2.py +195 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/relations_pb2.pyi +3613 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/types_pb2.py +95 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/proto/types_pb2.pyi +980 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/protobuf/__init__.py +18 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/protobuf/functions.py +166 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/readwriter.py +861 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/session.py +952 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/streaming/__init__.py +22 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/streaming/query.py +295 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/streaming/readwriter.py +618 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/streaming/worker/__init__.py +18 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/streaming/worker/foreach_batch_worker.py +87 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/streaming/worker/listener_worker.py +100 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/types.py +301 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/udf.py +296 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/udtf.py +200 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/utils.py +58 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/connect/window.py +266 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/context.py +818 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/dataframe.py +5973 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/functions.py +15889 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/group.py +547 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/observation.py +152 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/pandas/__init__.py +21 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/pandas/_typing/__init__.pyi +344 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/pandas/_typing/protocols/__init__.pyi +17 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/pandas/_typing/protocols/frame.pyi +20 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/pandas/_typing/protocols/series.pyi +20 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/pandas/conversion.py +671 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/pandas/functions.py +480 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/pandas/functions.pyi +132 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/pandas/group_ops.py +523 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/pandas/map_ops.py +216 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/pandas/serializers.py +1019 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/pandas/typehints.py +172 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/pandas/types.py +972 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/pandas/utils.py +86 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/protobuf/__init__.py +18 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/protobuf/functions.py +334 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/readwriter.py +2159 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/session.py +2088 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/sql_formatter.py +84 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/streaming/__init__.py +21 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/streaming/listener.py +1050 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/streaming/query.py +746 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/streaming/readwriter.py +1652 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/streaming/state.py +288 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/client/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/client/test_artifact.py +420 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/client/test_client.py +358 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/streaming/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/streaming/test_parity_foreach.py +36 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/streaming/test_parity_foreach_batch.py +44 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/streaming/test_parity_listener.py +116 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/streaming/test_parity_streaming.py +35 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_connect_basic.py +3612 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_connect_column.py +1042 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_connect_function.py +2381 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_connect_plan.py +1060 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_arrow.py +163 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_arrow_map.py +38 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_arrow_python_udf.py +48 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_catalog.py +36 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_column.py +55 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_conf.py +36 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_dataframe.py +96 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_datasources.py +44 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_errors.py +36 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_functions.py +59 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_group.py +36 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_cogrouped_map.py +59 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_grouped_map.py +74 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_grouped_map_with_state.py +62 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_map.py +58 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_udf.py +70 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_udf_grouped_agg.py +50 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_udf_scalar.py +68 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_udf_window.py +40 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_readwriter.py +46 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_serde.py +44 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_types.py +100 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_udf.py +100 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_udtf.py +163 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_session.py +181 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_utils.py +42 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_cogrouped_map.py +623 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_grouped_map.py +869 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_grouped_map_with_state.py +342 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_map.py +436 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_udf.py +363 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_udf_grouped_agg.py +592 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_udf_scalar.py +1503 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_udf_typehints.py +392 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_udf_typehints_with_future_annotations.py +375 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_udf_window.py +411 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/streaming/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/streaming/test_streaming.py +401 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/streaming/test_streaming_foreach.py +295 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/streaming/test_streaming_foreach_batch.py +106 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/streaming/test_streaming_listener.py +558 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_arrow.py +1346 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_arrow_map.py +182 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_arrow_python_udf.py +202 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_catalog.py +503 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_column.py +225 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_conf.py +83 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_context.py +201 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_dataframe.py +1931 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_datasources.py +256 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_errors.py +69 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_functions.py +1349 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_group.py +53 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_pandas_sqlmetrics.py +68 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_readwriter.py +283 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_serde.py +155 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_session.py +412 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_types.py +1581 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_udf.py +961 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_udf_profiler.py +165 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_udtf.py +1456 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_utils.py +1686 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/types.py +2558 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/udf.py +714 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/udtf.py +325 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/utils.py +339 -0
- snowflake/snowpark_connect/includes/python/pyspark/sql/window.py +492 -0
- snowflake/snowpark_connect/includes/python/pyspark/statcounter.py +165 -0
- snowflake/snowpark_connect/includes/python/pyspark/status.py +112 -0
- snowflake/snowpark_connect/includes/python/pyspark/storagelevel.py +97 -0
- snowflake/snowpark_connect/includes/python/pyspark/streaming/__init__.py +22 -0
- snowflake/snowpark_connect/includes/python/pyspark/streaming/context.py +471 -0
- snowflake/snowpark_connect/includes/python/pyspark/streaming/dstream.py +933 -0
- snowflake/snowpark_connect/includes/python/pyspark/streaming/kinesis.py +205 -0
- snowflake/snowpark_connect/includes/python/pyspark/streaming/listener.py +83 -0
- snowflake/snowpark_connect/includes/python/pyspark/streaming/tests/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/streaming/tests/test_context.py +184 -0
- snowflake/snowpark_connect/includes/python/pyspark/streaming/tests/test_dstream.py +706 -0
- snowflake/snowpark_connect/includes/python/pyspark/streaming/tests/test_kinesis.py +118 -0
- snowflake/snowpark_connect/includes/python/pyspark/streaming/tests/test_listener.py +160 -0
- snowflake/snowpark_connect/includes/python/pyspark/streaming/util.py +168 -0
- snowflake/snowpark_connect/includes/python/pyspark/taskcontext.py +502 -0
- snowflake/snowpark_connect/includes/python/pyspark/testing/__init__.py +21 -0
- snowflake/snowpark_connect/includes/python/pyspark/testing/connectutils.py +199 -0
- snowflake/snowpark_connect/includes/python/pyspark/testing/mllibutils.py +30 -0
- snowflake/snowpark_connect/includes/python/pyspark/testing/mlutils.py +275 -0
- snowflake/snowpark_connect/includes/python/pyspark/testing/objects.py +121 -0
- snowflake/snowpark_connect/includes/python/pyspark/testing/pandasutils.py +714 -0
- snowflake/snowpark_connect/includes/python/pyspark/testing/sqlutils.py +168 -0
- snowflake/snowpark_connect/includes/python/pyspark/testing/streamingutils.py +178 -0
- snowflake/snowpark_connect/includes/python/pyspark/testing/utils.py +636 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/__init__.py +16 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_appsubmit.py +306 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_broadcast.py +196 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_conf.py +44 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_context.py +346 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_daemon.py +89 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_install_spark.py +124 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_join.py +69 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_memory_profiler.py +167 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_pin_thread.py +194 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_profiler.py +168 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_rdd.py +939 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_rddbarrier.py +52 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_rddsampler.py +66 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_readwrite.py +368 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_serializers.py +257 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_shuffle.py +267 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_stage_sched.py +153 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_statcounter.py +130 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_taskcontext.py +350 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_util.py +97 -0
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_worker.py +271 -0
- snowflake/snowpark_connect/includes/python/pyspark/traceback_utils.py +81 -0
- snowflake/snowpark_connect/includes/python/pyspark/util.py +416 -0
- snowflake/snowpark_connect/includes/python/pyspark/version.py +19 -0
- snowflake/snowpark_connect/includes/python/pyspark/worker.py +1307 -0
- snowflake/snowpark_connect/includes/python/pyspark/worker_util.py +46 -0
- snowflake/snowpark_connect/proto/__init__.py +10 -0
- snowflake/snowpark_connect/proto/control_pb2.py +35 -0
- snowflake/snowpark_connect/proto/control_pb2.pyi +38 -0
- snowflake/snowpark_connect/proto/control_pb2_grpc.py +183 -0
- snowflake/snowpark_connect/proto/snowflake_expression_ext_pb2.py +35 -0
- snowflake/snowpark_connect/proto/snowflake_expression_ext_pb2.pyi +53 -0
- snowflake/snowpark_connect/proto/snowflake_rdd_pb2.pyi +39 -0
- snowflake/snowpark_connect/proto/snowflake_relation_ext_pb2.py +47 -0
- snowflake/snowpark_connect/proto/snowflake_relation_ext_pb2.pyi +111 -0
- snowflake/snowpark_connect/relation/__init__.py +3 -0
- snowflake/snowpark_connect/relation/catalogs/__init__.py +12 -0
- snowflake/snowpark_connect/relation/catalogs/abstract_spark_catalog.py +287 -0
- snowflake/snowpark_connect/relation/catalogs/snowflake_catalog.py +467 -0
- snowflake/snowpark_connect/relation/catalogs/utils.py +51 -0
- snowflake/snowpark_connect/relation/io_utils.py +76 -0
- snowflake/snowpark_connect/relation/map_aggregate.py +322 -0
- snowflake/snowpark_connect/relation/map_catalog.py +151 -0
- snowflake/snowpark_connect/relation/map_column_ops.py +1068 -0
- snowflake/snowpark_connect/relation/map_crosstab.py +48 -0
- snowflake/snowpark_connect/relation/map_extension.py +412 -0
- snowflake/snowpark_connect/relation/map_join.py +341 -0
- snowflake/snowpark_connect/relation/map_local_relation.py +326 -0
- snowflake/snowpark_connect/relation/map_map_partitions.py +146 -0
- snowflake/snowpark_connect/relation/map_relation.py +253 -0
- snowflake/snowpark_connect/relation/map_row_ops.py +716 -0
- snowflake/snowpark_connect/relation/map_sample_by.py +35 -0
- snowflake/snowpark_connect/relation/map_show_string.py +50 -0
- snowflake/snowpark_connect/relation/map_sql.py +1874 -0
- snowflake/snowpark_connect/relation/map_stats.py +324 -0
- snowflake/snowpark_connect/relation/map_subquery_alias.py +32 -0
- snowflake/snowpark_connect/relation/map_udtf.py +288 -0
- snowflake/snowpark_connect/relation/read/__init__.py +7 -0
- snowflake/snowpark_connect/relation/read/jdbc_read_dbapi.py +668 -0
- snowflake/snowpark_connect/relation/read/map_read.py +367 -0
- snowflake/snowpark_connect/relation/read/map_read_csv.py +142 -0
- snowflake/snowpark_connect/relation/read/map_read_jdbc.py +108 -0
- snowflake/snowpark_connect/relation/read/map_read_json.py +344 -0
- snowflake/snowpark_connect/relation/read/map_read_parquet.py +194 -0
- snowflake/snowpark_connect/relation/read/map_read_socket.py +59 -0
- snowflake/snowpark_connect/relation/read/map_read_table.py +109 -0
- snowflake/snowpark_connect/relation/read/map_read_text.py +106 -0
- snowflake/snowpark_connect/relation/read/reader_config.py +399 -0
- snowflake/snowpark_connect/relation/read/utils.py +155 -0
- snowflake/snowpark_connect/relation/stage_locator.py +161 -0
- snowflake/snowpark_connect/relation/utils.py +219 -0
- snowflake/snowpark_connect/relation/write/__init__.py +3 -0
- snowflake/snowpark_connect/relation/write/jdbc_write_dbapi.py +339 -0
- snowflake/snowpark_connect/relation/write/map_write.py +436 -0
- snowflake/snowpark_connect/relation/write/map_write_jdbc.py +48 -0
- snowflake/snowpark_connect/resources/java_udfs-1.0-SNAPSHOT.jar +0 -0
- snowflake/snowpark_connect/resources_initializer.py +75 -0
- snowflake/snowpark_connect/server.py +1136 -0
- snowflake/snowpark_connect/start_server.py +32 -0
- snowflake/snowpark_connect/tcm.py +8 -0
- snowflake/snowpark_connect/type_mapping.py +1003 -0
- snowflake/snowpark_connect/typed_column.py +94 -0
- snowflake/snowpark_connect/utils/__init__.py +3 -0
- snowflake/snowpark_connect/utils/artifacts.py +48 -0
- snowflake/snowpark_connect/utils/attribute_handling.py +72 -0
- snowflake/snowpark_connect/utils/cache.py +84 -0
- snowflake/snowpark_connect/utils/concurrent.py +124 -0
- snowflake/snowpark_connect/utils/context.py +390 -0
- snowflake/snowpark_connect/utils/describe_query_cache.py +231 -0
- snowflake/snowpark_connect/utils/interrupt.py +85 -0
- snowflake/snowpark_connect/utils/io_utils.py +35 -0
- snowflake/snowpark_connect/utils/pandas_udtf_utils.py +117 -0
- snowflake/snowpark_connect/utils/profiling.py +47 -0
- snowflake/snowpark_connect/utils/session.py +180 -0
- snowflake/snowpark_connect/utils/snowpark_connect_logging.py +38 -0
- snowflake/snowpark_connect/utils/telemetry.py +513 -0
- snowflake/snowpark_connect/utils/udf_cache.py +392 -0
- snowflake/snowpark_connect/utils/udf_helper.py +328 -0
- snowflake/snowpark_connect/utils/udf_utils.py +310 -0
- snowflake/snowpark_connect/utils/udtf_helper.py +420 -0
- snowflake/snowpark_connect/utils/udtf_utils.py +799 -0
- snowflake/snowpark_connect/utils/xxhash64.py +247 -0
- snowflake/snowpark_connect/version.py +6 -0
- snowpark_connect-0.20.2.data/scripts/snowpark-connect +71 -0
- snowpark_connect-0.20.2.data/scripts/snowpark-session +11 -0
- snowpark_connect-0.20.2.data/scripts/snowpark-submit +354 -0
- snowpark_connect-0.20.2.dist-info/METADATA +37 -0
- snowpark_connect-0.20.2.dist-info/RECORD +879 -0
- snowpark_connect-0.20.2.dist-info/WHEEL +5 -0
- snowpark_connect-0.20.2.dist-info/licenses/LICENSE.txt +202 -0
- snowpark_connect-0.20.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,844 @@
|
|
|
1
|
+
"""
|
|
2
|
+
New, fast version of the CloudPickler.
|
|
3
|
+
|
|
4
|
+
This new CloudPickler class can now extend the fast C Pickler instead of the
|
|
5
|
+
previous Python implementation of the Pickler class. Because this functionality
|
|
6
|
+
is only available for Python versions 3.8+, a lot of backward-compatibility
|
|
7
|
+
code is also removed.
|
|
8
|
+
|
|
9
|
+
Note that the C Pickler subclassing API is CPython-specific. Therefore, some
|
|
10
|
+
guards present in cloudpickle.py that were written to handle PyPy specificities
|
|
11
|
+
are not present in cloudpickle_fast.py
|
|
12
|
+
"""
|
|
13
|
+
import _collections_abc
|
|
14
|
+
import abc
|
|
15
|
+
import copyreg
|
|
16
|
+
import io
|
|
17
|
+
import itertools
|
|
18
|
+
import logging
|
|
19
|
+
import sys
|
|
20
|
+
import struct
|
|
21
|
+
import types
|
|
22
|
+
import weakref
|
|
23
|
+
import typing
|
|
24
|
+
|
|
25
|
+
from enum import Enum
|
|
26
|
+
from collections import ChainMap, OrderedDict
|
|
27
|
+
|
|
28
|
+
from .compat import pickle, Pickler
|
|
29
|
+
from .cloudpickle import (
|
|
30
|
+
_extract_code_globals, _BUILTIN_TYPE_NAMES, DEFAULT_PROTOCOL,
|
|
31
|
+
_find_imported_submodules, _get_cell_contents, _should_pickle_by_reference,
|
|
32
|
+
_builtin_type, _get_or_create_tracker_id, _make_skeleton_class,
|
|
33
|
+
_make_skeleton_enum, _extract_class_dict, dynamic_subimport, subimport,
|
|
34
|
+
_typevar_reduce, _get_bases, _make_cell, _make_empty_cell, CellType,
|
|
35
|
+
_is_parametrized_type_hint, PYPY, cell_set,
|
|
36
|
+
parametrized_type_hint_getinitargs, _create_parametrized_type_hint,
|
|
37
|
+
builtin_code_type,
|
|
38
|
+
_make_dict_keys, _make_dict_values, _make_dict_items, _make_function,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
if pickle.HIGHEST_PROTOCOL >= 5:
|
|
43
|
+
# Shorthands similar to pickle.dump/pickle.dumps
|
|
44
|
+
|
|
45
|
+
def dump(obj, file, protocol=None, buffer_callback=None):
|
|
46
|
+
"""Serialize obj as bytes streamed into file
|
|
47
|
+
|
|
48
|
+
protocol defaults to cloudpickle.DEFAULT_PROTOCOL which is an alias to
|
|
49
|
+
pickle.HIGHEST_PROTOCOL. This setting favors maximum communication
|
|
50
|
+
speed between processes running the same Python version.
|
|
51
|
+
|
|
52
|
+
Set protocol=pickle.DEFAULT_PROTOCOL instead if you need to ensure
|
|
53
|
+
compatibility with older versions of Python.
|
|
54
|
+
"""
|
|
55
|
+
CloudPickler(
|
|
56
|
+
file, protocol=protocol, buffer_callback=buffer_callback
|
|
57
|
+
).dump(obj)
|
|
58
|
+
|
|
59
|
+
def dumps(obj, protocol=None, buffer_callback=None):
|
|
60
|
+
"""Serialize obj as a string of bytes allocated in memory
|
|
61
|
+
|
|
62
|
+
protocol defaults to cloudpickle.DEFAULT_PROTOCOL which is an alias to
|
|
63
|
+
pickle.HIGHEST_PROTOCOL. This setting favors maximum communication
|
|
64
|
+
speed between processes running the same Python version.
|
|
65
|
+
|
|
66
|
+
Set protocol=pickle.DEFAULT_PROTOCOL instead if you need to ensure
|
|
67
|
+
compatibility with older versions of Python.
|
|
68
|
+
"""
|
|
69
|
+
with io.BytesIO() as file:
|
|
70
|
+
cp = CloudPickler(
|
|
71
|
+
file, protocol=protocol, buffer_callback=buffer_callback
|
|
72
|
+
)
|
|
73
|
+
cp.dump(obj)
|
|
74
|
+
return file.getvalue()
|
|
75
|
+
|
|
76
|
+
else:
|
|
77
|
+
# Shorthands similar to pickle.dump/pickle.dumps
|
|
78
|
+
def dump(obj, file, protocol=None):
|
|
79
|
+
"""Serialize obj as bytes streamed into file
|
|
80
|
+
|
|
81
|
+
protocol defaults to cloudpickle.DEFAULT_PROTOCOL which is an alias to
|
|
82
|
+
pickle.HIGHEST_PROTOCOL. This setting favors maximum communication
|
|
83
|
+
speed between processes running the same Python version.
|
|
84
|
+
|
|
85
|
+
Set protocol=pickle.DEFAULT_PROTOCOL instead if you need to ensure
|
|
86
|
+
compatibility with older versions of Python.
|
|
87
|
+
"""
|
|
88
|
+
CloudPickler(file, protocol=protocol).dump(obj)
|
|
89
|
+
|
|
90
|
+
def dumps(obj, protocol=None):
|
|
91
|
+
"""Serialize obj as a string of bytes allocated in memory
|
|
92
|
+
|
|
93
|
+
protocol defaults to cloudpickle.DEFAULT_PROTOCOL which is an alias to
|
|
94
|
+
pickle.HIGHEST_PROTOCOL. This setting favors maximum communication
|
|
95
|
+
speed between processes running the same Python version.
|
|
96
|
+
|
|
97
|
+
Set protocol=pickle.DEFAULT_PROTOCOL instead if you need to ensure
|
|
98
|
+
compatibility with older versions of Python.
|
|
99
|
+
"""
|
|
100
|
+
with io.BytesIO() as file:
|
|
101
|
+
cp = CloudPickler(file, protocol=protocol)
|
|
102
|
+
cp.dump(obj)
|
|
103
|
+
return file.getvalue()
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
load, loads = pickle.load, pickle.loads
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
# COLLECTION OF OBJECTS __getnewargs__-LIKE METHODS
|
|
110
|
+
# -------------------------------------------------
|
|
111
|
+
|
|
112
|
+
def _class_getnewargs(obj):
|
|
113
|
+
type_kwargs = {}
|
|
114
|
+
if "__module__" in obj.__dict__:
|
|
115
|
+
type_kwargs["__module__"] = obj.__module__
|
|
116
|
+
|
|
117
|
+
__dict__ = obj.__dict__.get('__dict__', None)
|
|
118
|
+
if isinstance(__dict__, property):
|
|
119
|
+
type_kwargs['__dict__'] = __dict__
|
|
120
|
+
|
|
121
|
+
return (type(obj), obj.__name__, _get_bases(obj), type_kwargs,
|
|
122
|
+
_get_or_create_tracker_id(obj), None)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def _enum_getnewargs(obj):
|
|
126
|
+
members = {e.name: e.value for e in obj}
|
|
127
|
+
return (obj.__bases__, obj.__name__, obj.__qualname__, members,
|
|
128
|
+
obj.__module__, _get_or_create_tracker_id(obj), None)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
# COLLECTION OF OBJECTS RECONSTRUCTORS
|
|
132
|
+
# ------------------------------------
|
|
133
|
+
def _file_reconstructor(retval):
|
|
134
|
+
return retval
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
# COLLECTION OF OBJECTS STATE GETTERS
|
|
138
|
+
# -----------------------------------
|
|
139
|
+
def _function_getstate(func):
|
|
140
|
+
# - Put func's dynamic attributes (stored in func.__dict__) in state. These
|
|
141
|
+
# attributes will be restored at unpickling time using
|
|
142
|
+
# f.__dict__.update(state)
|
|
143
|
+
# - Put func's members into slotstate. Such attributes will be restored at
|
|
144
|
+
# unpickling time by iterating over slotstate and calling setattr(func,
|
|
145
|
+
# slotname, slotvalue)
|
|
146
|
+
slotstate = {
|
|
147
|
+
"__name__": func.__name__,
|
|
148
|
+
"__qualname__": func.__qualname__,
|
|
149
|
+
"__annotations__": func.__annotations__,
|
|
150
|
+
"__kwdefaults__": func.__kwdefaults__,
|
|
151
|
+
"__defaults__": func.__defaults__,
|
|
152
|
+
"__module__": func.__module__,
|
|
153
|
+
"__doc__": func.__doc__,
|
|
154
|
+
"__closure__": func.__closure__,
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
f_globals_ref = _extract_code_globals(func.__code__)
|
|
158
|
+
f_globals = {k: func.__globals__[k] for k in f_globals_ref if k in
|
|
159
|
+
func.__globals__}
|
|
160
|
+
|
|
161
|
+
closure_values = (
|
|
162
|
+
list(map(_get_cell_contents, func.__closure__))
|
|
163
|
+
if func.__closure__ is not None else ()
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
# Extract currently-imported submodules used by func. Storing these modules
|
|
167
|
+
# in a smoke _cloudpickle_subimports attribute of the object's state will
|
|
168
|
+
# trigger the side effect of importing these modules at unpickling time
|
|
169
|
+
# (which is necessary for func to work correctly once depickled)
|
|
170
|
+
slotstate["_cloudpickle_submodules"] = _find_imported_submodules(
|
|
171
|
+
func.__code__, itertools.chain(f_globals.values(), closure_values))
|
|
172
|
+
slotstate["__globals__"] = f_globals
|
|
173
|
+
|
|
174
|
+
state = func.__dict__
|
|
175
|
+
return state, slotstate
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
def _class_getstate(obj):
|
|
179
|
+
clsdict = _extract_class_dict(obj)
|
|
180
|
+
clsdict.pop('__weakref__', None)
|
|
181
|
+
|
|
182
|
+
if issubclass(type(obj), abc.ABCMeta):
|
|
183
|
+
# If obj is an instance of an ABCMeta subclass, don't pickle the
|
|
184
|
+
# cache/negative caches populated during isinstance/issubclass
|
|
185
|
+
# checks, but pickle the list of registered subclasses of obj.
|
|
186
|
+
clsdict.pop('_abc_cache', None)
|
|
187
|
+
clsdict.pop('_abc_negative_cache', None)
|
|
188
|
+
clsdict.pop('_abc_negative_cache_version', None)
|
|
189
|
+
registry = clsdict.pop('_abc_registry', None)
|
|
190
|
+
if registry is None:
|
|
191
|
+
# in Python3.7+, the abc caches and registered subclasses of a
|
|
192
|
+
# class are bundled into the single _abc_impl attribute
|
|
193
|
+
clsdict.pop('_abc_impl', None)
|
|
194
|
+
(registry, _, _, _) = abc._get_dump(obj)
|
|
195
|
+
|
|
196
|
+
clsdict["_abc_impl"] = [subclass_weakref()
|
|
197
|
+
for subclass_weakref in registry]
|
|
198
|
+
else:
|
|
199
|
+
# In the above if clause, registry is a set of weakrefs -- in
|
|
200
|
+
# this case, registry is a WeakSet
|
|
201
|
+
clsdict["_abc_impl"] = [type_ for type_ in registry]
|
|
202
|
+
|
|
203
|
+
if "__slots__" in clsdict:
|
|
204
|
+
# pickle string length optimization: member descriptors of obj are
|
|
205
|
+
# created automatically from obj's __slots__ attribute, no need to
|
|
206
|
+
# save them in obj's state
|
|
207
|
+
if isinstance(obj.__slots__, str):
|
|
208
|
+
clsdict.pop(obj.__slots__)
|
|
209
|
+
else:
|
|
210
|
+
for k in obj.__slots__:
|
|
211
|
+
clsdict.pop(k, None)
|
|
212
|
+
|
|
213
|
+
clsdict.pop('__dict__', None) # unpicklable property object
|
|
214
|
+
|
|
215
|
+
return (clsdict, {})
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
def _enum_getstate(obj):
|
|
219
|
+
clsdict, slotstate = _class_getstate(obj)
|
|
220
|
+
|
|
221
|
+
members = {e.name: e.value for e in obj}
|
|
222
|
+
# Cleanup the clsdict that will be passed to _rehydrate_skeleton_class:
|
|
223
|
+
# Those attributes are already handled by the metaclass.
|
|
224
|
+
for attrname in ["_generate_next_value_", "_member_names_",
|
|
225
|
+
"_member_map_", "_member_type_",
|
|
226
|
+
"_value2member_map_"]:
|
|
227
|
+
clsdict.pop(attrname, None)
|
|
228
|
+
for member in members:
|
|
229
|
+
clsdict.pop(member)
|
|
230
|
+
# Special handling of Enum subclasses
|
|
231
|
+
return clsdict, slotstate
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
# COLLECTIONS OF OBJECTS REDUCERS
|
|
235
|
+
# -------------------------------
|
|
236
|
+
# A reducer is a function taking a single argument (obj), and that returns a
|
|
237
|
+
# tuple with all the necessary data to re-construct obj. Apart from a few
|
|
238
|
+
# exceptions (list, dict, bytes, int, etc.), a reducer is necessary to
|
|
239
|
+
# correctly pickle an object.
|
|
240
|
+
# While many built-in objects (Exceptions objects, instances of the "object"
|
|
241
|
+
# class, etc), are shipped with their own built-in reducer (invoked using
|
|
242
|
+
# obj.__reduce__), some do not. The following methods were created to "fill
|
|
243
|
+
# these holes".
|
|
244
|
+
|
|
245
|
+
def _code_reduce(obj):
|
|
246
|
+
"""codeobject reducer"""
|
|
247
|
+
# If you are not sure about the order of arguments, take a look at help
|
|
248
|
+
# of the specific type from types, for example:
|
|
249
|
+
# >>> from types import CodeType
|
|
250
|
+
# >>> help(CodeType)
|
|
251
|
+
if hasattr(obj, "co_exceptiontable"): # pragma: no branch
|
|
252
|
+
# Python 3.11 and later: there are some new attributes
|
|
253
|
+
# related to the enhanced exceptions.
|
|
254
|
+
args = (
|
|
255
|
+
obj.co_argcount, obj.co_posonlyargcount,
|
|
256
|
+
obj.co_kwonlyargcount, obj.co_nlocals, obj.co_stacksize,
|
|
257
|
+
obj.co_flags, obj.co_code, obj.co_consts, obj.co_names,
|
|
258
|
+
obj.co_varnames, obj.co_filename, obj.co_name, obj.co_qualname,
|
|
259
|
+
obj.co_firstlineno, obj.co_linetable, obj.co_exceptiontable,
|
|
260
|
+
obj.co_freevars, obj.co_cellvars,
|
|
261
|
+
)
|
|
262
|
+
elif hasattr(obj, "co_linetable"): # pragma: no branch
|
|
263
|
+
# Python 3.10 and later: obj.co_lnotab is deprecated and constructor
|
|
264
|
+
# expects obj.co_linetable instead.
|
|
265
|
+
args = (
|
|
266
|
+
obj.co_argcount, obj.co_posonlyargcount,
|
|
267
|
+
obj.co_kwonlyargcount, obj.co_nlocals, obj.co_stacksize,
|
|
268
|
+
obj.co_flags, obj.co_code, obj.co_consts, obj.co_names,
|
|
269
|
+
obj.co_varnames, obj.co_filename, obj.co_name,
|
|
270
|
+
obj.co_firstlineno, obj.co_linetable, obj.co_freevars,
|
|
271
|
+
obj.co_cellvars
|
|
272
|
+
)
|
|
273
|
+
elif hasattr(obj, "co_nmeta"): # pragma: no cover
|
|
274
|
+
# "nogil" Python: modified attributes from 3.9
|
|
275
|
+
args = (
|
|
276
|
+
obj.co_argcount, obj.co_posonlyargcount,
|
|
277
|
+
obj.co_kwonlyargcount, obj.co_nlocals, obj.co_framesize,
|
|
278
|
+
obj.co_ndefaultargs, obj.co_nmeta,
|
|
279
|
+
obj.co_flags, obj.co_code, obj.co_consts,
|
|
280
|
+
obj.co_varnames, obj.co_filename, obj.co_name,
|
|
281
|
+
obj.co_firstlineno, obj.co_lnotab, obj.co_exc_handlers,
|
|
282
|
+
obj.co_jump_table, obj.co_freevars, obj.co_cellvars,
|
|
283
|
+
obj.co_free2reg, obj.co_cell2reg
|
|
284
|
+
)
|
|
285
|
+
elif hasattr(obj, "co_posonlyargcount"):
|
|
286
|
+
# Backward compat for 3.9 and older
|
|
287
|
+
args = (
|
|
288
|
+
obj.co_argcount, obj.co_posonlyargcount,
|
|
289
|
+
obj.co_kwonlyargcount, obj.co_nlocals, obj.co_stacksize,
|
|
290
|
+
obj.co_flags, obj.co_code, obj.co_consts, obj.co_names,
|
|
291
|
+
obj.co_varnames, obj.co_filename, obj.co_name,
|
|
292
|
+
obj.co_firstlineno, obj.co_lnotab, obj.co_freevars,
|
|
293
|
+
obj.co_cellvars
|
|
294
|
+
)
|
|
295
|
+
else:
|
|
296
|
+
# Backward compat for even older versions of Python
|
|
297
|
+
args = (
|
|
298
|
+
obj.co_argcount, obj.co_kwonlyargcount, obj.co_nlocals,
|
|
299
|
+
obj.co_stacksize, obj.co_flags, obj.co_code, obj.co_consts,
|
|
300
|
+
obj.co_names, obj.co_varnames, obj.co_filename,
|
|
301
|
+
obj.co_name, obj.co_firstlineno, obj.co_lnotab,
|
|
302
|
+
obj.co_freevars, obj.co_cellvars
|
|
303
|
+
)
|
|
304
|
+
return types.CodeType, args
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
def _cell_reduce(obj):
|
|
308
|
+
"""Cell (containing values of a function's free variables) reducer"""
|
|
309
|
+
try:
|
|
310
|
+
obj.cell_contents
|
|
311
|
+
except ValueError: # cell is empty
|
|
312
|
+
return _make_empty_cell, ()
|
|
313
|
+
else:
|
|
314
|
+
return _make_cell, (obj.cell_contents, )
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
def _classmethod_reduce(obj):
|
|
318
|
+
orig_func = obj.__func__
|
|
319
|
+
return type(obj), (orig_func,)
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
def _file_reduce(obj):
|
|
323
|
+
"""Save a file"""
|
|
324
|
+
import io
|
|
325
|
+
|
|
326
|
+
if not hasattr(obj, "name") or not hasattr(obj, "mode"):
|
|
327
|
+
raise pickle.PicklingError(
|
|
328
|
+
"Cannot pickle files that do not map to an actual file"
|
|
329
|
+
)
|
|
330
|
+
if obj is sys.stdout:
|
|
331
|
+
return getattr, (sys, "stdout")
|
|
332
|
+
if obj is sys.stderr:
|
|
333
|
+
return getattr, (sys, "stderr")
|
|
334
|
+
if obj is sys.stdin:
|
|
335
|
+
raise pickle.PicklingError("Cannot pickle standard input")
|
|
336
|
+
if obj.closed:
|
|
337
|
+
raise pickle.PicklingError("Cannot pickle closed files")
|
|
338
|
+
if hasattr(obj, "isatty") and obj.isatty():
|
|
339
|
+
raise pickle.PicklingError(
|
|
340
|
+
"Cannot pickle files that map to tty objects"
|
|
341
|
+
)
|
|
342
|
+
if "r" not in obj.mode and "+" not in obj.mode:
|
|
343
|
+
raise pickle.PicklingError(
|
|
344
|
+
"Cannot pickle files that are not opened for reading: %s"
|
|
345
|
+
% obj.mode
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
name = obj.name
|
|
349
|
+
|
|
350
|
+
retval = io.StringIO()
|
|
351
|
+
|
|
352
|
+
try:
|
|
353
|
+
# Read the whole file
|
|
354
|
+
curloc = obj.tell()
|
|
355
|
+
obj.seek(0)
|
|
356
|
+
contents = obj.read()
|
|
357
|
+
obj.seek(curloc)
|
|
358
|
+
except IOError as e:
|
|
359
|
+
raise pickle.PicklingError(
|
|
360
|
+
"Cannot pickle file %s as it cannot be read" % name
|
|
361
|
+
) from e
|
|
362
|
+
retval.write(contents)
|
|
363
|
+
retval.seek(curloc)
|
|
364
|
+
|
|
365
|
+
retval.name = name
|
|
366
|
+
return _file_reconstructor, (retval,)
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
def _getset_descriptor_reduce(obj):
|
|
370
|
+
return getattr, (obj.__objclass__, obj.__name__)
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
def _mappingproxy_reduce(obj):
|
|
374
|
+
return types.MappingProxyType, (dict(obj),)
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
def _memoryview_reduce(obj):
|
|
378
|
+
return bytes, (obj.tobytes(),)
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
def _module_reduce(obj):
|
|
382
|
+
if _should_pickle_by_reference(obj):
|
|
383
|
+
return subimport, (obj.__name__,)
|
|
384
|
+
else:
|
|
385
|
+
# Some external libraries can populate the "__builtins__" entry of a
|
|
386
|
+
# module's `__dict__` with unpicklable objects (see #316). For that
|
|
387
|
+
# reason, we do not attempt to pickle the "__builtins__" entry, and
|
|
388
|
+
# restore a default value for it at unpickling time.
|
|
389
|
+
state = obj.__dict__.copy()
|
|
390
|
+
state.pop('__builtins__', None)
|
|
391
|
+
return dynamic_subimport, (obj.__name__, state)
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
def _method_reduce(obj):
|
|
395
|
+
return (types.MethodType, (obj.__func__, obj.__self__))
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
def _logger_reduce(obj):
|
|
399
|
+
return logging.getLogger, (obj.name,)
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
def _root_logger_reduce(obj):
|
|
403
|
+
return logging.getLogger, ()
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
def _property_reduce(obj):
|
|
407
|
+
return property, (obj.fget, obj.fset, obj.fdel, obj.__doc__)
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
def _weakset_reduce(obj):
|
|
411
|
+
return weakref.WeakSet, (list(obj),)
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
def _dynamic_class_reduce(obj):
|
|
415
|
+
"""
|
|
416
|
+
Save a class that can't be stored as module global.
|
|
417
|
+
|
|
418
|
+
This method is used to serialize classes that are defined inside
|
|
419
|
+
functions, or that otherwise can't be serialized as attribute lookups
|
|
420
|
+
from global modules.
|
|
421
|
+
"""
|
|
422
|
+
if Enum is not None and issubclass(obj, Enum):
|
|
423
|
+
return (
|
|
424
|
+
_make_skeleton_enum, _enum_getnewargs(obj), _enum_getstate(obj),
|
|
425
|
+
None, None, _class_setstate
|
|
426
|
+
)
|
|
427
|
+
else:
|
|
428
|
+
return (
|
|
429
|
+
_make_skeleton_class, _class_getnewargs(obj), _class_getstate(obj),
|
|
430
|
+
None, None, _class_setstate
|
|
431
|
+
)
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
def _class_reduce(obj):
|
|
435
|
+
"""Select the reducer depending on the dynamic nature of the class obj"""
|
|
436
|
+
if obj is type(None): # noqa
|
|
437
|
+
return type, (None,)
|
|
438
|
+
elif obj is type(Ellipsis):
|
|
439
|
+
return type, (Ellipsis,)
|
|
440
|
+
elif obj is type(NotImplemented):
|
|
441
|
+
return type, (NotImplemented,)
|
|
442
|
+
elif obj in _BUILTIN_TYPE_NAMES:
|
|
443
|
+
return _builtin_type, (_BUILTIN_TYPE_NAMES[obj],)
|
|
444
|
+
elif not _should_pickle_by_reference(obj):
|
|
445
|
+
return _dynamic_class_reduce(obj)
|
|
446
|
+
return NotImplemented
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
def _dict_keys_reduce(obj):
|
|
450
|
+
# Safer not to ship the full dict as sending the rest might
|
|
451
|
+
# be unintended and could potentially cause leaking of
|
|
452
|
+
# sensitive information
|
|
453
|
+
return _make_dict_keys, (list(obj), )
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
def _dict_values_reduce(obj):
|
|
457
|
+
# Safer not to ship the full dict as sending the rest might
|
|
458
|
+
# be unintended and could potentially cause leaking of
|
|
459
|
+
# sensitive information
|
|
460
|
+
return _make_dict_values, (list(obj), )
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
def _dict_items_reduce(obj):
|
|
464
|
+
return _make_dict_items, (dict(obj), )
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
def _odict_keys_reduce(obj):
|
|
468
|
+
# Safer not to ship the full dict as sending the rest might
|
|
469
|
+
# be unintended and could potentially cause leaking of
|
|
470
|
+
# sensitive information
|
|
471
|
+
return _make_dict_keys, (list(obj), True)
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
def _odict_values_reduce(obj):
|
|
475
|
+
# Safer not to ship the full dict as sending the rest might
|
|
476
|
+
# be unintended and could potentially cause leaking of
|
|
477
|
+
# sensitive information
|
|
478
|
+
return _make_dict_values, (list(obj), True)
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
def _odict_items_reduce(obj):
|
|
482
|
+
return _make_dict_items, (dict(obj), True)
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
# COLLECTIONS OF OBJECTS STATE SETTERS
|
|
486
|
+
# ------------------------------------
|
|
487
|
+
# state setters are called at unpickling time, once the object is created and
|
|
488
|
+
# it has to be updated to how it was at unpickling time.
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
def _function_setstate(obj, state):
|
|
492
|
+
"""Update the state of a dynamic function.
|
|
493
|
+
|
|
494
|
+
As __closure__ and __globals__ are readonly attributes of a function, we
|
|
495
|
+
cannot rely on the native setstate routine of pickle.load_build, that calls
|
|
496
|
+
setattr on items of the slotstate. Instead, we have to modify them inplace.
|
|
497
|
+
"""
|
|
498
|
+
state, slotstate = state
|
|
499
|
+
obj.__dict__.update(state)
|
|
500
|
+
|
|
501
|
+
obj_globals = slotstate.pop("__globals__")
|
|
502
|
+
obj_closure = slotstate.pop("__closure__")
|
|
503
|
+
# _cloudpickle_subimports is a set of submodules that must be loaded for
|
|
504
|
+
# the pickled function to work correctly at unpickling time. Now that these
|
|
505
|
+
# submodules are depickled (hence imported), they can be removed from the
|
|
506
|
+
# object's state (the object state only served as a reference holder to
|
|
507
|
+
# these submodules)
|
|
508
|
+
slotstate.pop("_cloudpickle_submodules")
|
|
509
|
+
|
|
510
|
+
obj.__globals__.update(obj_globals)
|
|
511
|
+
obj.__globals__["__builtins__"] = __builtins__
|
|
512
|
+
|
|
513
|
+
if obj_closure is not None:
|
|
514
|
+
for i, cell in enumerate(obj_closure):
|
|
515
|
+
try:
|
|
516
|
+
value = cell.cell_contents
|
|
517
|
+
except ValueError: # cell is empty
|
|
518
|
+
continue
|
|
519
|
+
cell_set(obj.__closure__[i], value)
|
|
520
|
+
|
|
521
|
+
for k, v in slotstate.items():
|
|
522
|
+
setattr(obj, k, v)
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
def _class_setstate(obj, state):
|
|
526
|
+
state, slotstate = state
|
|
527
|
+
registry = None
|
|
528
|
+
for attrname, attr in state.items():
|
|
529
|
+
if attrname == "_abc_impl":
|
|
530
|
+
registry = attr
|
|
531
|
+
else:
|
|
532
|
+
setattr(obj, attrname, attr)
|
|
533
|
+
if registry is not None:
|
|
534
|
+
for subclass in registry:
|
|
535
|
+
obj.register(subclass)
|
|
536
|
+
|
|
537
|
+
return obj
|
|
538
|
+
|
|
539
|
+
|
|
540
|
+
class CloudPickler(Pickler):
|
|
541
|
+
# set of reducers defined and used by cloudpickle (private)
|
|
542
|
+
_dispatch_table = {}
|
|
543
|
+
_dispatch_table[classmethod] = _classmethod_reduce
|
|
544
|
+
_dispatch_table[io.TextIOWrapper] = _file_reduce
|
|
545
|
+
_dispatch_table[logging.Logger] = _logger_reduce
|
|
546
|
+
_dispatch_table[logging.RootLogger] = _root_logger_reduce
|
|
547
|
+
_dispatch_table[memoryview] = _memoryview_reduce
|
|
548
|
+
_dispatch_table[property] = _property_reduce
|
|
549
|
+
_dispatch_table[staticmethod] = _classmethod_reduce
|
|
550
|
+
_dispatch_table[CellType] = _cell_reduce
|
|
551
|
+
_dispatch_table[types.CodeType] = _code_reduce
|
|
552
|
+
_dispatch_table[types.GetSetDescriptorType] = _getset_descriptor_reduce
|
|
553
|
+
_dispatch_table[types.ModuleType] = _module_reduce
|
|
554
|
+
_dispatch_table[types.MethodType] = _method_reduce
|
|
555
|
+
_dispatch_table[types.MappingProxyType] = _mappingproxy_reduce
|
|
556
|
+
_dispatch_table[weakref.WeakSet] = _weakset_reduce
|
|
557
|
+
_dispatch_table[typing.TypeVar] = _typevar_reduce
|
|
558
|
+
_dispatch_table[_collections_abc.dict_keys] = _dict_keys_reduce
|
|
559
|
+
_dispatch_table[_collections_abc.dict_values] = _dict_values_reduce
|
|
560
|
+
_dispatch_table[_collections_abc.dict_items] = _dict_items_reduce
|
|
561
|
+
_dispatch_table[type(OrderedDict().keys())] = _odict_keys_reduce
|
|
562
|
+
_dispatch_table[type(OrderedDict().values())] = _odict_values_reduce
|
|
563
|
+
_dispatch_table[type(OrderedDict().items())] = _odict_items_reduce
|
|
564
|
+
_dispatch_table[abc.abstractmethod] = _classmethod_reduce
|
|
565
|
+
_dispatch_table[abc.abstractclassmethod] = _classmethod_reduce
|
|
566
|
+
_dispatch_table[abc.abstractstaticmethod] = _classmethod_reduce
|
|
567
|
+
_dispatch_table[abc.abstractproperty] = _property_reduce
|
|
568
|
+
|
|
569
|
+
dispatch_table = ChainMap(_dispatch_table, copyreg.dispatch_table)
|
|
570
|
+
|
|
571
|
+
# function reducers are defined as instance methods of CloudPickler
|
|
572
|
+
# objects, as they rely on a CloudPickler attribute (globals_ref)
|
|
573
|
+
def _dynamic_function_reduce(self, func):
|
|
574
|
+
"""Reduce a function that is not pickleable via attribute lookup."""
|
|
575
|
+
newargs = self._function_getnewargs(func)
|
|
576
|
+
state = _function_getstate(func)
|
|
577
|
+
return (_make_function, newargs, state, None, None,
|
|
578
|
+
_function_setstate)
|
|
579
|
+
|
|
580
|
+
def _function_reduce(self, obj):
|
|
581
|
+
"""Reducer for function objects.
|
|
582
|
+
|
|
583
|
+
If obj is a top-level attribute of a file-backed module, this
|
|
584
|
+
reducer returns NotImplemented, making the CloudPickler fallback to
|
|
585
|
+
traditional _pickle.Pickler routines to save obj. Otherwise, it reduces
|
|
586
|
+
obj using a custom cloudpickle reducer designed specifically to handle
|
|
587
|
+
dynamic functions.
|
|
588
|
+
|
|
589
|
+
As opposed to cloudpickle.py, There no special handling for builtin
|
|
590
|
+
pypy functions because cloudpickle_fast is CPython-specific.
|
|
591
|
+
"""
|
|
592
|
+
if _should_pickle_by_reference(obj):
|
|
593
|
+
return NotImplemented
|
|
594
|
+
else:
|
|
595
|
+
return self._dynamic_function_reduce(obj)
|
|
596
|
+
|
|
597
|
+
def _function_getnewargs(self, func):
|
|
598
|
+
code = func.__code__
|
|
599
|
+
|
|
600
|
+
# base_globals represents the future global namespace of func at
|
|
601
|
+
# unpickling time. Looking it up and storing it in
|
|
602
|
+
# CloudpiPickler.globals_ref allow functions sharing the same globals
|
|
603
|
+
# at pickling time to also share them once unpickled, at one condition:
|
|
604
|
+
# since globals_ref is an attribute of a CloudPickler instance, and
|
|
605
|
+
# that a new CloudPickler is created each time pickle.dump or
|
|
606
|
+
# pickle.dumps is called, functions also need to be saved within the
|
|
607
|
+
# same invocation of cloudpickle.dump/cloudpickle.dumps (for example:
|
|
608
|
+
# cloudpickle.dumps([f1, f2])). There is no such limitation when using
|
|
609
|
+
# CloudPickler.dump, as long as the multiple invocations are bound to
|
|
610
|
+
# the same CloudPickler.
|
|
611
|
+
base_globals = self.globals_ref.setdefault(id(func.__globals__), {})
|
|
612
|
+
|
|
613
|
+
if base_globals == {}:
|
|
614
|
+
# Add module attributes used to resolve relative imports
|
|
615
|
+
# instructions inside func.
|
|
616
|
+
for k in ["__package__", "__name__", "__path__", "__file__"]:
|
|
617
|
+
if k in func.__globals__:
|
|
618
|
+
base_globals[k] = func.__globals__[k]
|
|
619
|
+
|
|
620
|
+
# Do not bind the free variables before the function is created to
|
|
621
|
+
# avoid infinite recursion.
|
|
622
|
+
if func.__closure__ is None:
|
|
623
|
+
closure = None
|
|
624
|
+
else:
|
|
625
|
+
closure = tuple(
|
|
626
|
+
_make_empty_cell() for _ in range(len(code.co_freevars)))
|
|
627
|
+
|
|
628
|
+
return code, base_globals, None, None, closure
|
|
629
|
+
|
|
630
|
+
def dump(self, obj):
|
|
631
|
+
try:
|
|
632
|
+
return Pickler.dump(self, obj)
|
|
633
|
+
except RuntimeError as e:
|
|
634
|
+
if len(e.args) > 0 and "recursion" in e.args[0]:
|
|
635
|
+
msg = (
|
|
636
|
+
"Could not pickle object as excessively deep recursion "
|
|
637
|
+
"required."
|
|
638
|
+
)
|
|
639
|
+
raise pickle.PicklingError(msg) from e
|
|
640
|
+
else:
|
|
641
|
+
raise
|
|
642
|
+
|
|
643
|
+
if pickle.HIGHEST_PROTOCOL >= 5:
|
|
644
|
+
def __init__(self, file, protocol=None, buffer_callback=None):
|
|
645
|
+
if protocol is None:
|
|
646
|
+
protocol = DEFAULT_PROTOCOL
|
|
647
|
+
Pickler.__init__(
|
|
648
|
+
self, file, protocol=protocol, buffer_callback=buffer_callback
|
|
649
|
+
)
|
|
650
|
+
# map functions __globals__ attribute ids, to ensure that functions
|
|
651
|
+
# sharing the same global namespace at pickling time also share
|
|
652
|
+
# their global namespace at unpickling time.
|
|
653
|
+
self.globals_ref = {}
|
|
654
|
+
self.proto = int(protocol)
|
|
655
|
+
else:
|
|
656
|
+
def __init__(self, file, protocol=None):
|
|
657
|
+
if protocol is None:
|
|
658
|
+
protocol = DEFAULT_PROTOCOL
|
|
659
|
+
Pickler.__init__(self, file, protocol=protocol)
|
|
660
|
+
# map functions __globals__ attribute ids, to ensure that functions
|
|
661
|
+
# sharing the same global namespace at pickling time also share
|
|
662
|
+
# their global namespace at unpickling time.
|
|
663
|
+
self.globals_ref = {}
|
|
664
|
+
assert hasattr(self, 'proto')
|
|
665
|
+
|
|
666
|
+
if pickle.HIGHEST_PROTOCOL >= 5 and not PYPY:
|
|
667
|
+
# Pickler is the C implementation of the CPython pickler and therefore
|
|
668
|
+
# we rely on reduce_override method to customize the pickler behavior.
|
|
669
|
+
|
|
670
|
+
# `CloudPickler.dispatch` is only left for backward compatibility - note
|
|
671
|
+
# that when using protocol 5, `CloudPickler.dispatch` is not an
|
|
672
|
+
# extension of `Pickler.dispatch` dictionary, because CloudPickler
|
|
673
|
+
# subclasses the C-implemented Pickler, which does not expose a
|
|
674
|
+
# `dispatch` attribute. Earlier versions of the protocol 5 CloudPickler
|
|
675
|
+
# used `CloudPickler.dispatch` as a class-level attribute storing all
|
|
676
|
+
# reducers implemented by cloudpickle, but the attribute name was not a
|
|
677
|
+
# great choice given the meaning of `CloudPickler.dispatch` when
|
|
678
|
+
# `CloudPickler` extends the pure-python pickler.
|
|
679
|
+
dispatch = dispatch_table
|
|
680
|
+
|
|
681
|
+
# Implementation of the reducer_override callback, in order to
|
|
682
|
+
# efficiently serialize dynamic functions and classes by subclassing
|
|
683
|
+
# the C-implemented Pickler.
|
|
684
|
+
# TODO: decorrelate reducer_override (which is tied to CPython's
|
|
685
|
+
# implementation - would it make sense to backport it to pypy? - and
|
|
686
|
+
# pickle's protocol 5 which is implementation agnostic. Currently, the
|
|
687
|
+
# availability of both notions coincide on CPython's pickle and the
|
|
688
|
+
# pickle5 backport, but it may not be the case anymore when pypy
|
|
689
|
+
# implements protocol 5
|
|
690
|
+
|
|
691
|
+
def reducer_override(self, obj):
|
|
692
|
+
"""Type-agnostic reducing callback for function and classes.
|
|
693
|
+
|
|
694
|
+
For performance reasons, subclasses of the C _pickle.Pickler class
|
|
695
|
+
cannot register custom reducers for functions and classes in the
|
|
696
|
+
dispatch_table. Reducer for such types must instead implemented in
|
|
697
|
+
the special reducer_override method.
|
|
698
|
+
|
|
699
|
+
Note that method will be called for any object except a few
|
|
700
|
+
builtin-types (int, lists, dicts etc.), which differs from reducers
|
|
701
|
+
in the Pickler's dispatch_table, each of them being invoked for
|
|
702
|
+
objects of a specific type only.
|
|
703
|
+
|
|
704
|
+
This property comes in handy for classes: although most classes are
|
|
705
|
+
instances of the ``type`` metaclass, some of them can be instances
|
|
706
|
+
of other custom metaclasses (such as enum.EnumMeta for example). In
|
|
707
|
+
particular, the metaclass will likely not be known in advance, and
|
|
708
|
+
thus cannot be special-cased using an entry in the dispatch_table.
|
|
709
|
+
reducer_override, among other things, allows us to register a
|
|
710
|
+
reducer that will be called for any class, independently of its
|
|
711
|
+
type.
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
Notes:
|
|
715
|
+
|
|
716
|
+
* reducer_override has the priority over dispatch_table-registered
|
|
717
|
+
reducers.
|
|
718
|
+
* reducer_override can be used to fix other limitations of
|
|
719
|
+
cloudpickle for other types that suffered from type-specific
|
|
720
|
+
reducers, such as Exceptions. See
|
|
721
|
+
https://github.com/cloudpipe/cloudpickle/issues/248
|
|
722
|
+
"""
|
|
723
|
+
if sys.version_info[:2] < (3, 7) and _is_parametrized_type_hint(obj): # noqa # pragma: no branch
|
|
724
|
+
return (
|
|
725
|
+
_create_parametrized_type_hint,
|
|
726
|
+
parametrized_type_hint_getinitargs(obj)
|
|
727
|
+
)
|
|
728
|
+
t = type(obj)
|
|
729
|
+
try:
|
|
730
|
+
is_anyclass = issubclass(t, type)
|
|
731
|
+
except TypeError: # t is not a class (old Boost; see SF #502085)
|
|
732
|
+
is_anyclass = False
|
|
733
|
+
|
|
734
|
+
if is_anyclass:
|
|
735
|
+
return _class_reduce(obj)
|
|
736
|
+
elif isinstance(obj, types.FunctionType):
|
|
737
|
+
return self._function_reduce(obj)
|
|
738
|
+
else:
|
|
739
|
+
# fallback to save_global, including the Pickler's
|
|
740
|
+
# dispatch_table
|
|
741
|
+
return NotImplemented
|
|
742
|
+
|
|
743
|
+
else:
|
|
744
|
+
# When reducer_override is not available, hack the pure-Python
|
|
745
|
+
# Pickler's types.FunctionType and type savers. Note: the type saver
|
|
746
|
+
# must override Pickler.save_global, because pickle.py contains a
|
|
747
|
+
# hard-coded call to save_global when pickling meta-classes.
|
|
748
|
+
dispatch = Pickler.dispatch.copy()
|
|
749
|
+
|
|
750
|
+
def _save_reduce_pickle5(self, func, args, state=None, listitems=None,
|
|
751
|
+
dictitems=None, state_setter=None, obj=None):
|
|
752
|
+
save = self.save
|
|
753
|
+
write = self.write
|
|
754
|
+
self.save_reduce(
|
|
755
|
+
func, args, state=None, listitems=listitems,
|
|
756
|
+
dictitems=dictitems, obj=obj
|
|
757
|
+
)
|
|
758
|
+
# backport of the Python 3.8 state_setter pickle operations
|
|
759
|
+
save(state_setter)
|
|
760
|
+
save(obj) # simple BINGET opcode as obj is already memoized.
|
|
761
|
+
save(state)
|
|
762
|
+
write(pickle.TUPLE2)
|
|
763
|
+
# Trigger a state_setter(obj, state) function call.
|
|
764
|
+
write(pickle.REDUCE)
|
|
765
|
+
# The purpose of state_setter is to carry-out an
|
|
766
|
+
# inplace modification of obj. We do not care about what the
|
|
767
|
+
# method might return, so its output is eventually removed from
|
|
768
|
+
# the stack.
|
|
769
|
+
write(pickle.POP)
|
|
770
|
+
|
|
771
|
+
def save_global(self, obj, name=None, pack=struct.pack):
|
|
772
|
+
"""
|
|
773
|
+
Save a "global".
|
|
774
|
+
|
|
775
|
+
The name of this method is somewhat misleading: all types get
|
|
776
|
+
dispatched here.
|
|
777
|
+
"""
|
|
778
|
+
if obj is type(None): # noqa
|
|
779
|
+
return self.save_reduce(type, (None,), obj=obj)
|
|
780
|
+
elif obj is type(Ellipsis):
|
|
781
|
+
return self.save_reduce(type, (Ellipsis,), obj=obj)
|
|
782
|
+
elif obj is type(NotImplemented):
|
|
783
|
+
return self.save_reduce(type, (NotImplemented,), obj=obj)
|
|
784
|
+
elif obj in _BUILTIN_TYPE_NAMES:
|
|
785
|
+
return self.save_reduce(
|
|
786
|
+
_builtin_type, (_BUILTIN_TYPE_NAMES[obj],), obj=obj)
|
|
787
|
+
|
|
788
|
+
if sys.version_info[:2] < (3, 7) and _is_parametrized_type_hint(obj): # noqa # pragma: no branch
|
|
789
|
+
# Parametrized typing constructs in Python < 3.7 are not
|
|
790
|
+
# compatible with type checks and ``isinstance`` semantics. For
|
|
791
|
+
# this reason, it is easier to detect them using a
|
|
792
|
+
# duck-typing-based check (``_is_parametrized_type_hint``) than
|
|
793
|
+
# to populate the Pickler's dispatch with type-specific savers.
|
|
794
|
+
self.save_reduce(
|
|
795
|
+
_create_parametrized_type_hint,
|
|
796
|
+
parametrized_type_hint_getinitargs(obj),
|
|
797
|
+
obj=obj
|
|
798
|
+
)
|
|
799
|
+
elif name is not None:
|
|
800
|
+
Pickler.save_global(self, obj, name=name)
|
|
801
|
+
elif not _should_pickle_by_reference(obj, name=name):
|
|
802
|
+
self._save_reduce_pickle5(*_dynamic_class_reduce(obj), obj=obj)
|
|
803
|
+
else:
|
|
804
|
+
Pickler.save_global(self, obj, name=name)
|
|
805
|
+
dispatch[type] = save_global
|
|
806
|
+
|
|
807
|
+
def save_function(self, obj, name=None):
|
|
808
|
+
""" Registered with the dispatch to handle all function types.
|
|
809
|
+
|
|
810
|
+
Determines what kind of function obj is (e.g. lambda, defined at
|
|
811
|
+
interactive prompt, etc) and handles the pickling appropriately.
|
|
812
|
+
"""
|
|
813
|
+
if _should_pickle_by_reference(obj, name=name):
|
|
814
|
+
return Pickler.save_global(self, obj, name=name)
|
|
815
|
+
elif PYPY and isinstance(obj.__code__, builtin_code_type):
|
|
816
|
+
return self.save_pypy_builtin_func(obj)
|
|
817
|
+
else:
|
|
818
|
+
return self._save_reduce_pickle5(
|
|
819
|
+
*self._dynamic_function_reduce(obj), obj=obj
|
|
820
|
+
)
|
|
821
|
+
|
|
822
|
+
def save_pypy_builtin_func(self, obj):
|
|
823
|
+
"""Save pypy equivalent of builtin functions.
|
|
824
|
+
PyPy does not have the concept of builtin-functions. Instead,
|
|
825
|
+
builtin-functions are simple function instances, but with a
|
|
826
|
+
builtin-code attribute.
|
|
827
|
+
Most of the time, builtin functions should be pickled by attribute.
|
|
828
|
+
But PyPy has flaky support for __qualname__, so some builtin
|
|
829
|
+
functions such as float.__new__ will be classified as dynamic. For
|
|
830
|
+
this reason only, we created this special routine. Because
|
|
831
|
+
builtin-functions are not expected to have closure or globals,
|
|
832
|
+
there is no additional hack (compared the one already implemented
|
|
833
|
+
in pickle) to protect ourselves from reference cycles. A simple
|
|
834
|
+
(reconstructor, newargs, obj.__dict__) tuple is save_reduced. Note
|
|
835
|
+
also that PyPy improved their support for __qualname__ in v3.6, so
|
|
836
|
+
this routing should be removed when cloudpickle supports only PyPy
|
|
837
|
+
3.6 and later.
|
|
838
|
+
"""
|
|
839
|
+
rv = (types.FunctionType, (obj.__code__, {}, obj.__name__,
|
|
840
|
+
obj.__defaults__, obj.__closure__),
|
|
841
|
+
obj.__dict__)
|
|
842
|
+
self.save_reduce(*rv, obj=obj)
|
|
843
|
+
|
|
844
|
+
dispatch[types.FunctionType] = save_function
|