snowpark-connect 0.23.0__py3-none-any.whl → 0.25.0__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/column_name_handler.py +116 -4
- snowflake/snowpark_connect/config.py +13 -0
- snowflake/snowpark_connect/constants.py +0 -29
- snowflake/snowpark_connect/dataframe_container.py +6 -0
- snowflake/snowpark_connect/execute_plan/map_execution_command.py +56 -1
- snowflake/snowpark_connect/expression/function_defaults.py +207 -0
- snowflake/snowpark_connect/expression/literal.py +18 -2
- snowflake/snowpark_connect/expression/map_cast.py +5 -8
- snowflake/snowpark_connect/expression/map_expression.py +10 -1
- snowflake/snowpark_connect/expression/map_extension.py +12 -2
- snowflake/snowpark_connect/expression/map_sql_expression.py +23 -1
- snowflake/snowpark_connect/expression/map_udf.py +26 -8
- snowflake/snowpark_connect/expression/map_unresolved_attribute.py +199 -15
- snowflake/snowpark_connect/expression/map_unresolved_extract_value.py +44 -16
- snowflake/snowpark_connect/expression/map_unresolved_function.py +836 -365
- snowflake/snowpark_connect/expression/map_unresolved_star.py +3 -2
- snowflake/snowpark_connect/hidden_column.py +39 -0
- snowflake/snowpark_connect/includes/jars/hadoop-client-api-trimmed-3.3.4.jar +0 -0
- snowflake/snowpark_connect/includes/jars/{hadoop-client-api-3.3.4.jar → spark-connect-client-jvm_2.12-3.5.6.jar} +0 -0
- snowflake/snowpark_connect/relation/map_column_ops.py +18 -36
- snowflake/snowpark_connect/relation/map_extension.py +56 -15
- snowflake/snowpark_connect/relation/map_join.py +258 -62
- snowflake/snowpark_connect/relation/map_row_ops.py +2 -29
- snowflake/snowpark_connect/relation/map_sql.py +88 -11
- snowflake/snowpark_connect/relation/map_udtf.py +4 -2
- snowflake/snowpark_connect/relation/read/map_read.py +3 -3
- snowflake/snowpark_connect/relation/read/map_read_jdbc.py +1 -1
- snowflake/snowpark_connect/relation/read/map_read_json.py +8 -1
- snowflake/snowpark_connect/relation/read/map_read_table.py +1 -9
- snowflake/snowpark_connect/relation/read/reader_config.py +3 -1
- snowflake/snowpark_connect/relation/read/utils.py +6 -7
- snowflake/snowpark_connect/relation/utils.py +1 -170
- snowflake/snowpark_connect/relation/write/map_write.py +62 -53
- snowflake/snowpark_connect/resources_initializer.py +29 -1
- snowflake/snowpark_connect/server.py +18 -3
- snowflake/snowpark_connect/type_mapping.py +29 -25
- snowflake/snowpark_connect/typed_column.py +14 -0
- snowflake/snowpark_connect/utils/artifacts.py +23 -0
- snowflake/snowpark_connect/utils/context.py +6 -1
- snowflake/snowpark_connect/utils/scala_udf_utils.py +588 -0
- snowflake/snowpark_connect/utils/telemetry.py +6 -17
- snowflake/snowpark_connect/utils/udf_helper.py +2 -0
- snowflake/snowpark_connect/utils/udf_utils.py +38 -7
- snowflake/snowpark_connect/utils/udtf_utils.py +17 -3
- snowflake/snowpark_connect/version.py +1 -1
- {snowpark_connect-0.23.0.dist-info → snowpark_connect-0.25.0.dist-info}/METADATA +1 -1
- snowpark_connect-0.25.0.dist-info/RECORD +477 -0
- snowflake/snowpark_connect/includes/jars/scala-compiler-2.12.18.jar +0 -0
- snowflake/snowpark_connect/includes/jars/spark-kubernetes_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-streaming_2.12-3.5.6.jar +0 -0
- snowflake/snowpark_connect/includes/python/pyspark/errors/tests/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/errors/tests/test_errors.py +0 -60
- snowflake/snowpark_connect/includes/python/pyspark/ml/deepspeed/tests/test_deepspeed_distributor.py +0 -306
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_connect_classification.py +0 -53
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_connect_evaluation.py +0 -50
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_connect_feature.py +0 -43
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_connect_function.py +0 -114
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_connect_pipeline.py +0 -47
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_connect_summarizer.py +0 -43
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_connect_tuning.py +0 -46
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_legacy_mode_classification.py +0 -238
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_legacy_mode_evaluation.py +0 -194
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_legacy_mode_feature.py +0 -156
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_legacy_mode_pipeline.py +0 -184
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_legacy_mode_summarizer.py +0 -78
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_legacy_mode_tuning.py +0 -292
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_parity_torch_data_loader.py +0 -50
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/connect/test_parity_torch_distributor.py +0 -152
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_algorithms.py +0 -456
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_base.py +0 -96
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_dl_util.py +0 -186
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_evaluation.py +0 -77
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_feature.py +0 -401
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_functions.py +0 -528
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_image.py +0 -82
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_linalg.py +0 -409
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_model_cache.py +0 -55
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_param.py +0 -441
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_persistence.py +0 -546
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_pipeline.py +0 -71
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_stat.py +0 -52
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_training_summary.py +0 -494
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_util.py +0 -85
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/test_wrapper.py +0 -138
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/test_cv_io_basic.py +0 -151
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/test_cv_io_nested.py +0 -97
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/test_cv_io_pipeline.py +0 -143
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/test_tuning.py +0 -551
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/test_tvs_io_basic.py +0 -137
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/test_tvs_io_nested.py +0 -96
- snowflake/snowpark_connect/includes/python/pyspark/ml/tests/tuning/test_tvs_io_pipeline.py +0 -142
- snowflake/snowpark_connect/includes/python/pyspark/ml/torch/tests/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/ml/torch/tests/test_data_loader.py +0 -137
- snowflake/snowpark_connect/includes/python/pyspark/ml/torch/tests/test_distributor.py +0 -561
- snowflake/snowpark_connect/includes/python/pyspark/ml/torch/tests/test_log_communication.py +0 -172
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tests/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tests/test_algorithms.py +0 -353
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tests/test_feature.py +0 -192
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tests/test_linalg.py +0 -680
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tests/test_stat.py +0 -206
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tests/test_streaming_algorithms.py +0 -471
- snowflake/snowpark_connect/includes/python/pyspark/mllib/tests/test_util.py +0 -108
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_any_all.py +0 -177
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_apply_func.py +0 -575
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_binary_ops.py +0 -235
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_combine.py +0 -653
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_compute.py +0 -463
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_corrwith.py +0 -86
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_cov.py +0 -151
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_cumulative.py +0 -139
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_describe.py +0 -458
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_eval.py +0 -86
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_melt.py +0 -202
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_missing_data.py +0 -520
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/computation/test_pivot.py +0 -361
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_any_all.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_apply_func.py +0 -42
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_binary_ops.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_combine.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_compute.py +0 -60
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_corrwith.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_cov.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_cumulative.py +0 -90
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_describe.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_eval.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_melt.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_missing_data.py +0 -42
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/computation/test_parity_pivot.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_base.py +0 -36
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_binary_ops.py +0 -42
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_boolean_ops.py +0 -47
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_categorical_ops.py +0 -55
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_complex_ops.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_date_ops.py +0 -47
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_datetime_ops.py +0 -47
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_null_ops.py +0 -42
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_num_arithmetic.py +0 -43
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_num_ops.py +0 -47
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_num_reverse.py +0 -43
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_string_ops.py +0 -47
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_timedelta_ops.py +0 -47
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/test_parity_udt_ops.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/data_type_ops/testing_utils.py +0 -226
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_align.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_basic_slow.py +0 -55
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_cov_corrwith.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_dot_frame.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_dot_series.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_index.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_series.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_setitem_frame.py +0 -43
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/diff_frames_ops/test_parity_setitem_series.py +0 -43
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_attrs.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_constructor.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_conversion.py +0 -42
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_reindexing.py +0 -42
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_reshaping.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_spark.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_take.py +0 -42
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_time_series.py +0 -48
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/frame/test_parity_truncate.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_aggregate.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_apply_func.py +0 -41
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_cumulative.py +0 -67
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_describe.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_groupby.py +0 -55
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_head_tail.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_index.py +0 -38
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_missing_data.py +0 -55
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_split_apply.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/groupby/test_parity_stat.py +0 -38
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_align.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_base.py +0 -50
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_category.py +0 -73
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_datetime.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_indexing.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_reindex.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_rename.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_reset_index.py +0 -48
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/indexes/test_parity_timedelta.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/io/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/io/test_parity_io.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/plot/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/plot/test_parity_frame_plot.py +0 -45
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/plot/test_parity_frame_plot_matplotlib.py +0 -45
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/plot/test_parity_frame_plot_plotly.py +0 -49
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/plot/test_parity_series_plot.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/plot/test_parity_series_plot_matplotlib.py +0 -53
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/plot/test_parity_series_plot_plotly.py +0 -45
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_all_any.py +0 -38
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_arg_ops.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_as_of.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_as_type.py +0 -38
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_compute.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_conversion.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_cumulative.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_index.py +0 -38
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_missing_data.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_series.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_sort.py +0 -38
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/series/test_parity_stat.py +0 -38
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_categorical.py +0 -66
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_config.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_csv.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_dataframe_conversion.py +0 -42
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_dataframe_spark_io.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_default_index.py +0 -49
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_ewm.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_expanding.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_extension.py +0 -49
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_frame_spark.py +0 -53
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_generic_functions.py +0 -43
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_indexing.py +0 -49
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_indexops_spark.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_internal.py +0 -41
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_namespace.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_numpy_compat.py +0 -60
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_ops_on_diff_frames.py +0 -48
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_ops_on_diff_frames_groupby.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_ops_on_diff_frames_groupby_expanding.py +0 -44
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_ops_on_diff_frames_groupby_rolling.py +0 -84
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_repr.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_resample.py +0 -45
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_reshape.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_rolling.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_scalars.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_series_conversion.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_series_datetime.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_series_string.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_spark_functions.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_sql.py +0 -43
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_stats.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_typedef.py +0 -36
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_utils.py +0 -37
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/connect/test_parity_window.py +0 -39
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_base.py +0 -107
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_binary_ops.py +0 -224
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_boolean_ops.py +0 -825
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_categorical_ops.py +0 -562
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_complex_ops.py +0 -368
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_date_ops.py +0 -257
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_datetime_ops.py +0 -260
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_null_ops.py +0 -178
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_num_arithmetic.py +0 -184
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_num_ops.py +0 -497
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_num_reverse.py +0 -140
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_string_ops.py +0 -354
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_timedelta_ops.py +0 -219
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/test_udt_ops.py +0 -192
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/data_type_ops/testing_utils.py +0 -228
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_align.py +0 -118
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_basic_slow.py +0 -198
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_cov_corrwith.py +0 -181
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_dot_frame.py +0 -103
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_dot_series.py +0 -141
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_index.py +0 -109
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_series.py +0 -136
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_setitem_frame.py +0 -125
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/diff_frames_ops/test_setitem_series.py +0 -217
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_attrs.py +0 -384
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_constructor.py +0 -598
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_conversion.py +0 -73
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_reindexing.py +0 -869
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_reshaping.py +0 -487
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_spark.py +0 -309
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_take.py +0 -156
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_time_series.py +0 -149
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/frame/test_truncate.py +0 -163
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_aggregate.py +0 -311
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_apply_func.py +0 -524
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_cumulative.py +0 -419
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_describe.py +0 -144
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_groupby.py +0 -979
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_head_tail.py +0 -234
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_index.py +0 -206
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_missing_data.py +0 -421
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_split_apply.py +0 -187
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/groupby/test_stat.py +0 -397
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_align.py +0 -100
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_base.py +0 -2743
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_category.py +0 -484
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_datetime.py +0 -276
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_indexing.py +0 -432
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_reindex.py +0 -310
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_rename.py +0 -257
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_reset_index.py +0 -160
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/indexes/test_timedelta.py +0 -128
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/io/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/io/test_io.py +0 -137
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/plot/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/plot/test_frame_plot.py +0 -170
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/plot/test_frame_plot_matplotlib.py +0 -547
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/plot/test_frame_plot_plotly.py +0 -285
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/plot/test_series_plot.py +0 -106
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/plot/test_series_plot_matplotlib.py +0 -409
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/plot/test_series_plot_plotly.py +0 -247
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_all_any.py +0 -105
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_arg_ops.py +0 -197
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_as_of.py +0 -137
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_as_type.py +0 -227
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_compute.py +0 -634
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_conversion.py +0 -88
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_cumulative.py +0 -139
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_index.py +0 -475
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_missing_data.py +0 -265
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_series.py +0 -818
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_sort.py +0 -162
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/series/test_stat.py +0 -780
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_categorical.py +0 -741
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_config.py +0 -160
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_csv.py +0 -453
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_dataframe_conversion.py +0 -281
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_dataframe_spark_io.py +0 -487
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_default_index.py +0 -109
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_ewm.py +0 -434
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_expanding.py +0 -253
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_extension.py +0 -152
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_frame_spark.py +0 -162
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_generic_functions.py +0 -234
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_indexing.py +0 -1339
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_indexops_spark.py +0 -82
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_internal.py +0 -124
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_namespace.py +0 -638
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_numpy_compat.py +0 -200
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_ops_on_diff_frames.py +0 -1355
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_ops_on_diff_frames_groupby.py +0 -655
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_ops_on_diff_frames_groupby_expanding.py +0 -113
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_ops_on_diff_frames_groupby_rolling.py +0 -118
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_repr.py +0 -192
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_resample.py +0 -346
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_reshape.py +0 -495
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_rolling.py +0 -263
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_scalars.py +0 -59
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_series_conversion.py +0 -85
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_series_datetime.py +0 -364
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_series_string.py +0 -362
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_spark_functions.py +0 -46
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_sql.py +0 -123
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_stats.py +0 -581
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_typedef.py +0 -447
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_utils.py +0 -301
- snowflake/snowpark_connect/includes/python/pyspark/pandas/tests/test_window.py +0 -465
- snowflake/snowpark_connect/includes/python/pyspark/resource/tests/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/resource/tests/test_resources.py +0 -83
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/client/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/client/test_artifact.py +0 -420
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/client/test_client.py +0 -358
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/streaming/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/streaming/test_parity_foreach.py +0 -36
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/streaming/test_parity_foreach_batch.py +0 -44
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/streaming/test_parity_listener.py +0 -116
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/streaming/test_parity_streaming.py +0 -35
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_connect_basic.py +0 -3612
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_connect_column.py +0 -1042
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_connect_function.py +0 -2381
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_connect_plan.py +0 -1060
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_arrow.py +0 -163
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_arrow_map.py +0 -38
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_arrow_python_udf.py +0 -48
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_catalog.py +0 -36
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_column.py +0 -55
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_conf.py +0 -36
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_dataframe.py +0 -96
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_datasources.py +0 -44
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_errors.py +0 -36
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_functions.py +0 -59
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_group.py +0 -36
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_cogrouped_map.py +0 -59
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_grouped_map.py +0 -74
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_grouped_map_with_state.py +0 -62
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_map.py +0 -58
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_udf.py +0 -70
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_udf_grouped_agg.py +0 -50
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_udf_scalar.py +0 -68
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_pandas_udf_window.py +0 -40
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_readwriter.py +0 -46
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_serde.py +0 -44
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_types.py +0 -100
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_udf.py +0 -100
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_parity_udtf.py +0 -163
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_session.py +0 -181
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/connect/test_utils.py +0 -42
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_cogrouped_map.py +0 -623
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_grouped_map.py +0 -869
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_grouped_map_with_state.py +0 -342
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_map.py +0 -436
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_udf.py +0 -363
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_udf_grouped_agg.py +0 -592
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_udf_scalar.py +0 -1503
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_udf_typehints.py +0 -392
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_udf_typehints_with_future_annotations.py +0 -375
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_udf_window.py +0 -411
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/streaming/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/streaming/test_streaming.py +0 -401
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/streaming/test_streaming_foreach.py +0 -295
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/streaming/test_streaming_foreach_batch.py +0 -106
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/streaming/test_streaming_listener.py +0 -558
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_arrow.py +0 -1346
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_arrow_map.py +0 -182
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_arrow_python_udf.py +0 -202
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_catalog.py +0 -503
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_column.py +0 -225
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_conf.py +0 -83
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_context.py +0 -201
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_dataframe.py +0 -1931
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_datasources.py +0 -256
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_errors.py +0 -69
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_functions.py +0 -1349
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_group.py +0 -53
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_pandas_sqlmetrics.py +0 -68
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_readwriter.py +0 -283
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_serde.py +0 -155
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_session.py +0 -412
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_types.py +0 -1581
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_udf.py +0 -961
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_udf_profiler.py +0 -165
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_udtf.py +0 -1456
- snowflake/snowpark_connect/includes/python/pyspark/sql/tests/test_utils.py +0 -1686
- snowflake/snowpark_connect/includes/python/pyspark/streaming/tests/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/streaming/tests/test_context.py +0 -184
- snowflake/snowpark_connect/includes/python/pyspark/streaming/tests/test_dstream.py +0 -706
- snowflake/snowpark_connect/includes/python/pyspark/streaming/tests/test_kinesis.py +0 -118
- snowflake/snowpark_connect/includes/python/pyspark/streaming/tests/test_listener.py +0 -160
- snowflake/snowpark_connect/includes/python/pyspark/tests/__init__.py +0 -16
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_appsubmit.py +0 -306
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_broadcast.py +0 -196
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_conf.py +0 -44
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_context.py +0 -346
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_daemon.py +0 -89
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_install_spark.py +0 -124
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_join.py +0 -69
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_memory_profiler.py +0 -167
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_pin_thread.py +0 -194
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_profiler.py +0 -168
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_rdd.py +0 -939
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_rddbarrier.py +0 -52
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_rddsampler.py +0 -66
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_readwrite.py +0 -368
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_serializers.py +0 -257
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_shuffle.py +0 -267
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_stage_sched.py +0 -153
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_statcounter.py +0 -130
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_taskcontext.py +0 -350
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_util.py +0 -97
- snowflake/snowpark_connect/includes/python/pyspark/tests/test_worker.py +0 -271
- snowpark_connect-0.23.0.dist-info/RECORD +0 -893
- {snowpark_connect-0.23.0.data → snowpark_connect-0.25.0.data}/scripts/snowpark-connect +0 -0
- {snowpark_connect-0.23.0.data → snowpark_connect-0.25.0.data}/scripts/snowpark-session +0 -0
- {snowpark_connect-0.23.0.data → snowpark_connect-0.25.0.data}/scripts/snowpark-submit +0 -0
- {snowpark_connect-0.23.0.dist-info → snowpark_connect-0.25.0.dist-info}/WHEEL +0 -0
- {snowpark_connect-0.23.0.dist-info → snowpark_connect-0.25.0.dist-info}/licenses/LICENSE-binary +0 -0
- {snowpark_connect-0.23.0.dist-info → snowpark_connect-0.25.0.dist-info}/licenses/LICENSE.txt +0 -0
- {snowpark_connect-0.23.0.dist-info → snowpark_connect-0.25.0.dist-info}/licenses/NOTICE-binary +0 -0
- {snowpark_connect-0.23.0.dist-info → snowpark_connect-0.25.0.dist-info}/top_level.txt +0 -0
snowflake/snowpark_connect/includes/python/pyspark/sql/tests/pandas/test_pandas_udf_grouped_agg.py
DELETED
|
@@ -1,592 +0,0 @@
|
|
|
1
|
-
#
|
|
2
|
-
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
3
|
-
# contributor license agreements. See the NOTICE file distributed with
|
|
4
|
-
# this work for additional information regarding copyright ownership.
|
|
5
|
-
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
6
|
-
# (the "License"); you may not use this file except in compliance with
|
|
7
|
-
# the License. You may obtain a copy of the License at
|
|
8
|
-
#
|
|
9
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
11
|
-
# Unless required by applicable law or agreed to in writing, software
|
|
12
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
-
# See the License for the specific language governing permissions and
|
|
15
|
-
# limitations under the License.
|
|
16
|
-
#
|
|
17
|
-
|
|
18
|
-
import unittest
|
|
19
|
-
from typing import cast
|
|
20
|
-
|
|
21
|
-
from pyspark.rdd import PythonEvalType
|
|
22
|
-
from pyspark.sql import Row
|
|
23
|
-
from pyspark.sql.functions import (
|
|
24
|
-
array,
|
|
25
|
-
explode,
|
|
26
|
-
col,
|
|
27
|
-
lit,
|
|
28
|
-
mean,
|
|
29
|
-
sum,
|
|
30
|
-
udf,
|
|
31
|
-
pandas_udf,
|
|
32
|
-
PandasUDFType,
|
|
33
|
-
)
|
|
34
|
-
from pyspark.sql.types import ArrayType, YearMonthIntervalType
|
|
35
|
-
from pyspark.errors import AnalysisException, PySparkNotImplementedError
|
|
36
|
-
from pyspark.testing.sqlutils import (
|
|
37
|
-
ReusedSQLTestCase,
|
|
38
|
-
have_pandas,
|
|
39
|
-
have_pyarrow,
|
|
40
|
-
pandas_requirement_message,
|
|
41
|
-
pyarrow_requirement_message,
|
|
42
|
-
)
|
|
43
|
-
from pyspark.testing.utils import QuietTest
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if have_pandas:
|
|
47
|
-
import pandas as pd
|
|
48
|
-
from pandas.testing import assert_frame_equal
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
@unittest.skipIf(
|
|
52
|
-
not have_pandas or not have_pyarrow,
|
|
53
|
-
cast(str, pandas_requirement_message or pyarrow_requirement_message),
|
|
54
|
-
)
|
|
55
|
-
class GroupedAggPandasUDFTestsMixin:
|
|
56
|
-
@property
|
|
57
|
-
def data(self):
|
|
58
|
-
return (
|
|
59
|
-
self.spark.range(10)
|
|
60
|
-
.toDF("id")
|
|
61
|
-
.withColumn("vs", array([lit(i * 1.0) + col("id") for i in range(20, 30)]))
|
|
62
|
-
.withColumn("v", explode(col("vs")))
|
|
63
|
-
.drop("vs")
|
|
64
|
-
.withColumn("w", lit(1.0))
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
@property
|
|
68
|
-
def python_plus_one(self):
|
|
69
|
-
@udf("double")
|
|
70
|
-
def plus_one(v):
|
|
71
|
-
assert isinstance(v, (int, float))
|
|
72
|
-
return float(v + 1)
|
|
73
|
-
|
|
74
|
-
return plus_one
|
|
75
|
-
|
|
76
|
-
@property
|
|
77
|
-
def pandas_scalar_plus_two(self):
|
|
78
|
-
@pandas_udf("double", PandasUDFType.SCALAR)
|
|
79
|
-
def plus_two(v):
|
|
80
|
-
assert isinstance(v, pd.Series)
|
|
81
|
-
return v + 2
|
|
82
|
-
|
|
83
|
-
return plus_two
|
|
84
|
-
|
|
85
|
-
@property
|
|
86
|
-
def pandas_agg_mean_udf(self):
|
|
87
|
-
@pandas_udf("double", PandasUDFType.GROUPED_AGG)
|
|
88
|
-
def avg(v):
|
|
89
|
-
return v.mean()
|
|
90
|
-
|
|
91
|
-
return avg
|
|
92
|
-
|
|
93
|
-
@property
|
|
94
|
-
def pandas_agg_sum_udf(self):
|
|
95
|
-
@pandas_udf("double", PandasUDFType.GROUPED_AGG)
|
|
96
|
-
def sum(v):
|
|
97
|
-
return v.sum()
|
|
98
|
-
|
|
99
|
-
return sum
|
|
100
|
-
|
|
101
|
-
@property
|
|
102
|
-
def pandas_agg_weighted_mean_udf(self):
|
|
103
|
-
import numpy as np
|
|
104
|
-
|
|
105
|
-
@pandas_udf("double", PandasUDFType.GROUPED_AGG)
|
|
106
|
-
def weighted_mean(v, w):
|
|
107
|
-
return np.average(v, weights=w)
|
|
108
|
-
|
|
109
|
-
return weighted_mean
|
|
110
|
-
|
|
111
|
-
def test_manual(self):
|
|
112
|
-
df = self.data
|
|
113
|
-
sum_udf = self.pandas_agg_sum_udf
|
|
114
|
-
mean_udf = self.pandas_agg_mean_udf
|
|
115
|
-
mean_arr_udf = pandas_udf(
|
|
116
|
-
self.pandas_agg_mean_udf.func,
|
|
117
|
-
ArrayType(self.pandas_agg_mean_udf.returnType),
|
|
118
|
-
self.pandas_agg_mean_udf.evalType,
|
|
119
|
-
)
|
|
120
|
-
|
|
121
|
-
result1 = (
|
|
122
|
-
df.groupby("id")
|
|
123
|
-
.agg(sum_udf(df.v), mean_udf(df.v), mean_arr_udf(array(df.v)))
|
|
124
|
-
.sort("id")
|
|
125
|
-
)
|
|
126
|
-
expected1 = self.spark.createDataFrame(
|
|
127
|
-
[
|
|
128
|
-
[0, 245.0, 24.5, [24.5]],
|
|
129
|
-
[1, 255.0, 25.5, [25.5]],
|
|
130
|
-
[2, 265.0, 26.5, [26.5]],
|
|
131
|
-
[3, 275.0, 27.5, [27.5]],
|
|
132
|
-
[4, 285.0, 28.5, [28.5]],
|
|
133
|
-
[5, 295.0, 29.5, [29.5]],
|
|
134
|
-
[6, 305.0, 30.5, [30.5]],
|
|
135
|
-
[7, 315.0, 31.5, [31.5]],
|
|
136
|
-
[8, 325.0, 32.5, [32.5]],
|
|
137
|
-
[9, 335.0, 33.5, [33.5]],
|
|
138
|
-
],
|
|
139
|
-
["id", "sum(v)", "avg(v)", "avg(array(v))"],
|
|
140
|
-
)
|
|
141
|
-
|
|
142
|
-
assert_frame_equal(expected1.toPandas(), result1.toPandas())
|
|
143
|
-
|
|
144
|
-
def test_basic(self):
|
|
145
|
-
df = self.data
|
|
146
|
-
weighted_mean_udf = self.pandas_agg_weighted_mean_udf
|
|
147
|
-
|
|
148
|
-
# Groupby one column and aggregate one UDF with literal
|
|
149
|
-
result1 = df.groupby("id").agg(weighted_mean_udf(df.v, lit(1.0))).sort("id")
|
|
150
|
-
expected1 = df.groupby("id").agg(mean(df.v).alias("weighted_mean(v, 1.0)")).sort("id")
|
|
151
|
-
assert_frame_equal(expected1.toPandas(), result1.toPandas())
|
|
152
|
-
|
|
153
|
-
# Groupby one expression and aggregate one UDF with literal
|
|
154
|
-
result2 = df.groupby((col("id") + 1)).agg(weighted_mean_udf(df.v, lit(1.0))).sort(df.id + 1)
|
|
155
|
-
expected2 = (
|
|
156
|
-
df.groupby((col("id") + 1))
|
|
157
|
-
.agg(mean(df.v).alias("weighted_mean(v, 1.0)"))
|
|
158
|
-
.sort(df.id + 1)
|
|
159
|
-
)
|
|
160
|
-
assert_frame_equal(expected2.toPandas(), result2.toPandas())
|
|
161
|
-
|
|
162
|
-
# Groupby one column and aggregate one UDF without literal
|
|
163
|
-
result3 = df.groupby("id").agg(weighted_mean_udf(df.v, df.w)).sort("id")
|
|
164
|
-
expected3 = df.groupby("id").agg(mean(df.v).alias("weighted_mean(v, w)")).sort("id")
|
|
165
|
-
assert_frame_equal(expected3.toPandas(), result3.toPandas())
|
|
166
|
-
|
|
167
|
-
# Groupby one expression and aggregate one UDF without literal
|
|
168
|
-
result4 = (
|
|
169
|
-
df.groupby((col("id") + 1).alias("id")).agg(weighted_mean_udf(df.v, df.w)).sort("id")
|
|
170
|
-
)
|
|
171
|
-
expected4 = (
|
|
172
|
-
df.groupby((col("id") + 1).alias("id"))
|
|
173
|
-
.agg(mean(df.v).alias("weighted_mean(v, w)"))
|
|
174
|
-
.sort("id")
|
|
175
|
-
)
|
|
176
|
-
assert_frame_equal(expected4.toPandas(), result4.toPandas())
|
|
177
|
-
|
|
178
|
-
def test_unsupported_types(self):
|
|
179
|
-
with QuietTest(self.sc):
|
|
180
|
-
self.check_unsupported_types()
|
|
181
|
-
|
|
182
|
-
def check_unsupported_types(self):
|
|
183
|
-
with self.assertRaises(PySparkNotImplementedError) as pe:
|
|
184
|
-
pandas_udf(
|
|
185
|
-
lambda x: x,
|
|
186
|
-
ArrayType(ArrayType(YearMonthIntervalType())),
|
|
187
|
-
PandasUDFType.GROUPED_AGG,
|
|
188
|
-
)
|
|
189
|
-
|
|
190
|
-
self.check_error(
|
|
191
|
-
exception=pe.exception,
|
|
192
|
-
error_class="NOT_IMPLEMENTED",
|
|
193
|
-
message_parameters={
|
|
194
|
-
"feature": "Invalid return type with grouped aggregate Pandas UDFs: "
|
|
195
|
-
"ArrayType(ArrayType(YearMonthIntervalType(0, 1), True), True)"
|
|
196
|
-
},
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
with self.assertRaises(PySparkNotImplementedError) as pe:
|
|
200
|
-
|
|
201
|
-
@pandas_udf("mean double, std double", PandasUDFType.GROUPED_AGG)
|
|
202
|
-
def mean_and_std_udf(v):
|
|
203
|
-
return v.mean(), v.std()
|
|
204
|
-
|
|
205
|
-
self.check_error(
|
|
206
|
-
exception=pe.exception,
|
|
207
|
-
error_class="NOT_IMPLEMENTED",
|
|
208
|
-
message_parameters={
|
|
209
|
-
"feature": "Invalid return type with grouped aggregate Pandas UDFs: "
|
|
210
|
-
"StructType([StructField('mean', DoubleType(), True), "
|
|
211
|
-
"StructField('std', DoubleType(), True)])"
|
|
212
|
-
},
|
|
213
|
-
)
|
|
214
|
-
|
|
215
|
-
with self.assertRaises(PySparkNotImplementedError) as pe:
|
|
216
|
-
|
|
217
|
-
@pandas_udf(ArrayType(YearMonthIntervalType()), PandasUDFType.GROUPED_AGG)
|
|
218
|
-
def mean_and_std_udf(v): # noqa: F811
|
|
219
|
-
return {v.mean(): v.std()}
|
|
220
|
-
|
|
221
|
-
self.check_error(
|
|
222
|
-
exception=pe.exception,
|
|
223
|
-
error_class="NOT_IMPLEMENTED",
|
|
224
|
-
message_parameters={
|
|
225
|
-
"feature": "Invalid return type with grouped aggregate Pandas UDFs: "
|
|
226
|
-
"ArrayType(YearMonthIntervalType(0, 1), True)"
|
|
227
|
-
},
|
|
228
|
-
)
|
|
229
|
-
|
|
230
|
-
def test_alias(self):
|
|
231
|
-
df = self.data
|
|
232
|
-
mean_udf = self.pandas_agg_mean_udf
|
|
233
|
-
|
|
234
|
-
result1 = df.groupby("id").agg(mean_udf(df.v).alias("mean_alias"))
|
|
235
|
-
expected1 = df.groupby("id").agg(mean(df.v).alias("mean_alias"))
|
|
236
|
-
|
|
237
|
-
assert_frame_equal(expected1.toPandas(), result1.toPandas())
|
|
238
|
-
|
|
239
|
-
def test_mixed_sql(self):
|
|
240
|
-
"""
|
|
241
|
-
Test mixing group aggregate pandas UDF with sql expression.
|
|
242
|
-
"""
|
|
243
|
-
df = self.data
|
|
244
|
-
sum_udf = self.pandas_agg_sum_udf
|
|
245
|
-
|
|
246
|
-
# Mix group aggregate pandas UDF with sql expression
|
|
247
|
-
result1 = df.groupby("id").agg(sum_udf(df.v) + 1).sort("id")
|
|
248
|
-
expected1 = df.groupby("id").agg(sum(df.v) + 1).sort("id")
|
|
249
|
-
|
|
250
|
-
# Mix group aggregate pandas UDF with sql expression (order swapped)
|
|
251
|
-
result2 = df.groupby("id").agg(sum_udf(df.v + 1)).sort("id")
|
|
252
|
-
|
|
253
|
-
expected2 = df.groupby("id").agg(sum(df.v + 1)).sort("id")
|
|
254
|
-
|
|
255
|
-
# Wrap group aggregate pandas UDF with two sql expressions
|
|
256
|
-
result3 = df.groupby("id").agg(sum_udf(df.v + 1) + 2).sort("id")
|
|
257
|
-
expected3 = df.groupby("id").agg(sum(df.v + 1) + 2).sort("id")
|
|
258
|
-
|
|
259
|
-
assert_frame_equal(expected1.toPandas(), result1.toPandas())
|
|
260
|
-
assert_frame_equal(expected2.toPandas(), result2.toPandas())
|
|
261
|
-
assert_frame_equal(expected3.toPandas(), result3.toPandas())
|
|
262
|
-
|
|
263
|
-
def test_mixed_udfs(self):
|
|
264
|
-
"""
|
|
265
|
-
Test mixing group aggregate pandas UDF with python UDF and scalar pandas UDF.
|
|
266
|
-
"""
|
|
267
|
-
df = self.data
|
|
268
|
-
plus_one = self.python_plus_one
|
|
269
|
-
plus_two = self.pandas_scalar_plus_two
|
|
270
|
-
sum_udf = self.pandas_agg_sum_udf
|
|
271
|
-
|
|
272
|
-
# Mix group aggregate pandas UDF and python UDF
|
|
273
|
-
result1 = df.groupby("id").agg(plus_one(sum_udf(df.v))).sort("id")
|
|
274
|
-
expected1 = df.groupby("id").agg(plus_one(sum(df.v))).sort("id")
|
|
275
|
-
|
|
276
|
-
# Mix group aggregate pandas UDF and python UDF (order swapped)
|
|
277
|
-
result2 = df.groupby("id").agg(sum_udf(plus_one(df.v))).sort("id")
|
|
278
|
-
expected2 = df.groupby("id").agg(sum(plus_one(df.v))).sort("id")
|
|
279
|
-
|
|
280
|
-
# Mix group aggregate pandas UDF and scalar pandas UDF
|
|
281
|
-
result3 = df.groupby("id").agg(sum_udf(plus_two(df.v))).sort("id")
|
|
282
|
-
expected3 = df.groupby("id").agg(sum(plus_two(df.v))).sort("id")
|
|
283
|
-
|
|
284
|
-
# Mix group aggregate pandas UDF and scalar pandas UDF (order swapped)
|
|
285
|
-
result4 = df.groupby("id").agg(plus_two(sum_udf(df.v))).sort("id")
|
|
286
|
-
expected4 = df.groupby("id").agg(plus_two(sum(df.v))).sort("id")
|
|
287
|
-
|
|
288
|
-
# Wrap group aggregate pandas UDF with two python UDFs and use python UDF in groupby
|
|
289
|
-
result5 = (
|
|
290
|
-
df.groupby(plus_one(df.id)).agg(plus_one(sum_udf(plus_one(df.v)))).sort("plus_one(id)")
|
|
291
|
-
)
|
|
292
|
-
expected5 = (
|
|
293
|
-
df.groupby(plus_one(df.id)).agg(plus_one(sum(plus_one(df.v)))).sort("plus_one(id)")
|
|
294
|
-
)
|
|
295
|
-
|
|
296
|
-
# Wrap group aggregate pandas UDF with two scala pandas UDF and user scala pandas UDF in
|
|
297
|
-
# groupby
|
|
298
|
-
result6 = (
|
|
299
|
-
df.groupby(plus_two(df.id)).agg(plus_two(sum_udf(plus_two(df.v)))).sort("plus_two(id)")
|
|
300
|
-
)
|
|
301
|
-
expected6 = (
|
|
302
|
-
df.groupby(plus_two(df.id)).agg(plus_two(sum(plus_two(df.v)))).sort("plus_two(id)")
|
|
303
|
-
)
|
|
304
|
-
|
|
305
|
-
assert_frame_equal(expected1.toPandas(), result1.toPandas())
|
|
306
|
-
assert_frame_equal(expected2.toPandas(), result2.toPandas())
|
|
307
|
-
assert_frame_equal(expected3.toPandas(), result3.toPandas())
|
|
308
|
-
assert_frame_equal(expected4.toPandas(), result4.toPandas())
|
|
309
|
-
assert_frame_equal(expected5.toPandas(), result5.toPandas())
|
|
310
|
-
assert_frame_equal(expected6.toPandas(), result6.toPandas())
|
|
311
|
-
|
|
312
|
-
def test_multiple_udfs(self):
|
|
313
|
-
"""
|
|
314
|
-
Test multiple group aggregate pandas UDFs in one agg function.
|
|
315
|
-
"""
|
|
316
|
-
df = self.data
|
|
317
|
-
mean_udf = self.pandas_agg_mean_udf
|
|
318
|
-
sum_udf = self.pandas_agg_sum_udf
|
|
319
|
-
weighted_mean_udf = self.pandas_agg_weighted_mean_udf
|
|
320
|
-
|
|
321
|
-
result1 = (
|
|
322
|
-
df.groupBy("id")
|
|
323
|
-
.agg(mean_udf(df.v), sum_udf(df.v), weighted_mean_udf(df.v, df.w))
|
|
324
|
-
.sort("id")
|
|
325
|
-
.toPandas()
|
|
326
|
-
)
|
|
327
|
-
expected1 = (
|
|
328
|
-
df.groupBy("id")
|
|
329
|
-
.agg(mean(df.v), sum(df.v), mean(df.v).alias("weighted_mean(v, w)"))
|
|
330
|
-
.sort("id")
|
|
331
|
-
.toPandas()
|
|
332
|
-
)
|
|
333
|
-
|
|
334
|
-
assert_frame_equal(expected1, result1)
|
|
335
|
-
|
|
336
|
-
def test_complex_groupby(self):
|
|
337
|
-
df = self.data
|
|
338
|
-
sum_udf = self.pandas_agg_sum_udf
|
|
339
|
-
plus_one = self.python_plus_one
|
|
340
|
-
plus_two = self.pandas_scalar_plus_two
|
|
341
|
-
|
|
342
|
-
# groupby one expression
|
|
343
|
-
result1 = df.groupby(df.v % 2).agg(sum_udf(df.v))
|
|
344
|
-
expected1 = df.groupby(df.v % 2).agg(sum(df.v))
|
|
345
|
-
|
|
346
|
-
# empty groupby
|
|
347
|
-
result2 = df.groupby().agg(sum_udf(df.v))
|
|
348
|
-
expected2 = df.groupby().agg(sum(df.v))
|
|
349
|
-
|
|
350
|
-
# groupby one column and one sql expression
|
|
351
|
-
result3 = df.groupby(df.id, df.v % 2).agg(sum_udf(df.v)).orderBy(df.id, df.v % 2)
|
|
352
|
-
expected3 = df.groupby(df.id, df.v % 2).agg(sum(df.v)).orderBy(df.id, df.v % 2)
|
|
353
|
-
|
|
354
|
-
# groupby one python UDF
|
|
355
|
-
result4 = df.groupby(plus_one(df.id)).agg(sum_udf(df.v)).sort("plus_one(id)")
|
|
356
|
-
expected4 = df.groupby(plus_one(df.id)).agg(sum(df.v)).sort("plus_one(id)")
|
|
357
|
-
|
|
358
|
-
# groupby one scalar pandas UDF
|
|
359
|
-
result5 = df.groupby(plus_two(df.id)).agg(sum_udf(df.v)).sort("sum(v)")
|
|
360
|
-
expected5 = df.groupby(plus_two(df.id)).agg(sum(df.v)).sort("sum(v)")
|
|
361
|
-
|
|
362
|
-
# groupby one expression and one python UDF
|
|
363
|
-
result6 = (
|
|
364
|
-
df.groupby(df.v % 2, plus_one(df.id))
|
|
365
|
-
.agg(sum_udf(df.v))
|
|
366
|
-
.sort(["(v % 2)", "plus_one(id)"])
|
|
367
|
-
)
|
|
368
|
-
expected6 = (
|
|
369
|
-
df.groupby(df.v % 2, plus_one(df.id)).agg(sum(df.v)).sort(["(v % 2)", "plus_one(id)"])
|
|
370
|
-
)
|
|
371
|
-
|
|
372
|
-
# groupby one expression and one scalar pandas UDF
|
|
373
|
-
result7 = (
|
|
374
|
-
df.groupby(df.v % 2, plus_two(df.id))
|
|
375
|
-
.agg(sum_udf(df.v))
|
|
376
|
-
.sort(["sum(v)", "plus_two(id)"])
|
|
377
|
-
)
|
|
378
|
-
expected7 = (
|
|
379
|
-
df.groupby(df.v % 2, plus_two(df.id)).agg(sum(df.v)).sort(["sum(v)", "plus_two(id)"])
|
|
380
|
-
)
|
|
381
|
-
|
|
382
|
-
assert_frame_equal(expected1.toPandas(), result1.toPandas())
|
|
383
|
-
assert_frame_equal(expected2.toPandas(), result2.toPandas())
|
|
384
|
-
assert_frame_equal(expected3.toPandas(), result3.toPandas())
|
|
385
|
-
assert_frame_equal(expected4.toPandas(), result4.toPandas())
|
|
386
|
-
assert_frame_equal(expected5.toPandas(), result5.toPandas())
|
|
387
|
-
assert_frame_equal(expected6.toPandas(), result6.toPandas())
|
|
388
|
-
assert_frame_equal(expected7.toPandas(), result7.toPandas())
|
|
389
|
-
|
|
390
|
-
def test_complex_expressions(self):
|
|
391
|
-
df = self.data
|
|
392
|
-
plus_one = self.python_plus_one
|
|
393
|
-
plus_two = self.pandas_scalar_plus_two
|
|
394
|
-
sum_udf = self.pandas_agg_sum_udf
|
|
395
|
-
|
|
396
|
-
# Test complex expressions with sql expression, python UDF and
|
|
397
|
-
# group aggregate pandas UDF
|
|
398
|
-
result1 = (
|
|
399
|
-
df.withColumn("v1", plus_one(df.v))
|
|
400
|
-
.withColumn("v2", df.v + 2)
|
|
401
|
-
.groupby(df.id, df.v % 2)
|
|
402
|
-
.agg(
|
|
403
|
-
sum_udf(col("v")),
|
|
404
|
-
sum_udf(col("v1") + 3),
|
|
405
|
-
sum_udf(col("v2")) + 5,
|
|
406
|
-
plus_one(sum_udf(col("v1"))),
|
|
407
|
-
sum_udf(plus_one(col("v2"))),
|
|
408
|
-
)
|
|
409
|
-
.sort(["id", "(v % 2)"])
|
|
410
|
-
.toPandas()
|
|
411
|
-
.sort_values(by=["id", "(v % 2)"])
|
|
412
|
-
)
|
|
413
|
-
|
|
414
|
-
expected1 = (
|
|
415
|
-
df.withColumn("v1", df.v + 1)
|
|
416
|
-
.withColumn("v2", df.v + 2)
|
|
417
|
-
.groupby(df.id, df.v % 2)
|
|
418
|
-
.agg(
|
|
419
|
-
sum(col("v")),
|
|
420
|
-
sum(col("v1") + 3),
|
|
421
|
-
sum(col("v2")) + 5,
|
|
422
|
-
plus_one(sum(col("v1"))),
|
|
423
|
-
sum(plus_one(col("v2"))),
|
|
424
|
-
)
|
|
425
|
-
.sort(["id", "(v % 2)"])
|
|
426
|
-
.toPandas()
|
|
427
|
-
.sort_values(by=["id", "(v % 2)"])
|
|
428
|
-
)
|
|
429
|
-
|
|
430
|
-
# Test complex expressions with sql expression, scala pandas UDF and
|
|
431
|
-
# group aggregate pandas UDF
|
|
432
|
-
result2 = (
|
|
433
|
-
df.withColumn("v1", plus_one(df.v))
|
|
434
|
-
.withColumn("v2", df.v + 2)
|
|
435
|
-
.groupby(df.id, df.v % 2)
|
|
436
|
-
.agg(
|
|
437
|
-
sum_udf(col("v")),
|
|
438
|
-
sum_udf(col("v1") + 3),
|
|
439
|
-
sum_udf(col("v2")) + 5,
|
|
440
|
-
plus_two(sum_udf(col("v1"))),
|
|
441
|
-
sum_udf(plus_two(col("v2"))),
|
|
442
|
-
)
|
|
443
|
-
.sort(["id", "(v % 2)"])
|
|
444
|
-
.toPandas()
|
|
445
|
-
.sort_values(by=["id", "(v % 2)"])
|
|
446
|
-
)
|
|
447
|
-
|
|
448
|
-
expected2 = (
|
|
449
|
-
df.withColumn("v1", df.v + 1)
|
|
450
|
-
.withColumn("v2", df.v + 2)
|
|
451
|
-
.groupby(df.id, df.v % 2)
|
|
452
|
-
.agg(
|
|
453
|
-
sum(col("v")),
|
|
454
|
-
sum(col("v1") + 3),
|
|
455
|
-
sum(col("v2")) + 5,
|
|
456
|
-
plus_two(sum(col("v1"))),
|
|
457
|
-
sum(plus_two(col("v2"))),
|
|
458
|
-
)
|
|
459
|
-
.sort(["id", "(v % 2)"])
|
|
460
|
-
.toPandas()
|
|
461
|
-
.sort_values(by=["id", "(v % 2)"])
|
|
462
|
-
)
|
|
463
|
-
|
|
464
|
-
# Test sequential groupby aggregate
|
|
465
|
-
result3 = (
|
|
466
|
-
df.groupby("id")
|
|
467
|
-
.agg(sum_udf(df.v).alias("v"))
|
|
468
|
-
.groupby("id")
|
|
469
|
-
.agg(sum_udf(col("v")))
|
|
470
|
-
.sort("id")
|
|
471
|
-
.toPandas()
|
|
472
|
-
)
|
|
473
|
-
|
|
474
|
-
expected3 = (
|
|
475
|
-
df.groupby("id")
|
|
476
|
-
.agg(sum(df.v).alias("v"))
|
|
477
|
-
.groupby("id")
|
|
478
|
-
.agg(sum(col("v")))
|
|
479
|
-
.sort("id")
|
|
480
|
-
.toPandas()
|
|
481
|
-
)
|
|
482
|
-
|
|
483
|
-
assert_frame_equal(expected1, result1)
|
|
484
|
-
assert_frame_equal(expected2, result2)
|
|
485
|
-
assert_frame_equal(expected3, result3)
|
|
486
|
-
|
|
487
|
-
def test_retain_group_columns(self):
|
|
488
|
-
with self.sql_conf({"spark.sql.retainGroupColumns": False}):
|
|
489
|
-
df = self.data
|
|
490
|
-
sum_udf = self.pandas_agg_sum_udf
|
|
491
|
-
|
|
492
|
-
result1 = df.groupby(df.id).agg(sum_udf(df.v))
|
|
493
|
-
expected1 = df.groupby(df.id).agg(sum(df.v))
|
|
494
|
-
assert_frame_equal(expected1.toPandas(), result1.toPandas())
|
|
495
|
-
|
|
496
|
-
def test_array_type(self):
|
|
497
|
-
df = self.data
|
|
498
|
-
|
|
499
|
-
array_udf = pandas_udf(lambda x: [1.0, 2.0], "array<double>", PandasUDFType.GROUPED_AGG)
|
|
500
|
-
result1 = df.groupby("id").agg(array_udf(df["v"]).alias("v2"))
|
|
501
|
-
self.assertEqual(result1.first()["v2"], [1.0, 2.0])
|
|
502
|
-
|
|
503
|
-
def test_invalid_args(self):
|
|
504
|
-
with QuietTest(self.sc):
|
|
505
|
-
self.check_invalid_args()
|
|
506
|
-
|
|
507
|
-
def check_invalid_args(self):
|
|
508
|
-
df = self.data
|
|
509
|
-
plus_one = self.python_plus_one
|
|
510
|
-
mean_udf = self.pandas_agg_mean_udf
|
|
511
|
-
with self.assertRaisesRegex(AnalysisException, "[MISSING_AGGREGATION]"):
|
|
512
|
-
df.groupby(df.id).agg(plus_one(df.v)).collect()
|
|
513
|
-
with self.assertRaisesRegex(
|
|
514
|
-
AnalysisException, "aggregate function.*argument.*aggregate function"
|
|
515
|
-
):
|
|
516
|
-
df.groupby(df.id).agg(mean_udf(mean_udf(df.v))).collect()
|
|
517
|
-
with self.assertRaisesRegex(
|
|
518
|
-
AnalysisException,
|
|
519
|
-
"The group aggregate pandas UDF `avg` cannot be invoked together with as other, "
|
|
520
|
-
"non-pandas aggregate functions.",
|
|
521
|
-
):
|
|
522
|
-
df.groupby(df.id).agg(mean_udf(df.v), mean(df.v)).collect()
|
|
523
|
-
|
|
524
|
-
def test_register_vectorized_udf_basic(self):
|
|
525
|
-
sum_pandas_udf = pandas_udf(
|
|
526
|
-
lambda v: v.sum(), "integer", PythonEvalType.SQL_GROUPED_AGG_PANDAS_UDF
|
|
527
|
-
)
|
|
528
|
-
|
|
529
|
-
self.assertEqual(sum_pandas_udf.evalType, PythonEvalType.SQL_GROUPED_AGG_PANDAS_UDF)
|
|
530
|
-
group_agg_pandas_udf = self.spark.udf.register("sum_pandas_udf", sum_pandas_udf)
|
|
531
|
-
self.assertEqual(group_agg_pandas_udf.evalType, PythonEvalType.SQL_GROUPED_AGG_PANDAS_UDF)
|
|
532
|
-
q = "SELECT sum_pandas_udf(v1) FROM VALUES (3, 0), (2, 0), (1, 1) tbl(v1, v2) GROUP BY v2"
|
|
533
|
-
actual = sorted(map(lambda r: r[0], self.spark.sql(q).collect()))
|
|
534
|
-
expected = [1, 5]
|
|
535
|
-
self.assertEqual(actual, expected)
|
|
536
|
-
|
|
537
|
-
def test_grouped_with_empty_partition(self):
|
|
538
|
-
data = [Row(id=1, x=2), Row(id=1, x=3), Row(id=2, x=4)]
|
|
539
|
-
expected = [Row(id=1, sum=5), Row(id=2, x=4)]
|
|
540
|
-
num_parts = len(data) + 1
|
|
541
|
-
df = self.spark.createDataFrame(self.sc.parallelize(data, numSlices=num_parts))
|
|
542
|
-
|
|
543
|
-
f = pandas_udf(lambda x: x.sum(), "int", PandasUDFType.GROUPED_AGG)
|
|
544
|
-
|
|
545
|
-
result = df.groupBy("id").agg(f(df["x"]).alias("sum")).collect()
|
|
546
|
-
self.assertEqual(result, expected)
|
|
547
|
-
|
|
548
|
-
def test_grouped_without_group_by_clause(self):
|
|
549
|
-
@pandas_udf("double", PandasUDFType.GROUPED_AGG)
|
|
550
|
-
def max_udf(v):
|
|
551
|
-
return v.max()
|
|
552
|
-
|
|
553
|
-
df = self.spark.range(0, 100)
|
|
554
|
-
self.spark.udf.register("max_udf", max_udf)
|
|
555
|
-
|
|
556
|
-
with self.tempView("table"):
|
|
557
|
-
df.createTempView("table")
|
|
558
|
-
|
|
559
|
-
agg1 = df.agg(max_udf(df["id"]))
|
|
560
|
-
agg2 = self.spark.sql("select max_udf(id) from table")
|
|
561
|
-
assert_frame_equal(agg1.toPandas(), agg2.toPandas())
|
|
562
|
-
|
|
563
|
-
def test_no_predicate_pushdown_through(self):
|
|
564
|
-
# SPARK-30921: We should not pushdown predicates of PythonUDFs through Aggregate.
|
|
565
|
-
import numpy as np
|
|
566
|
-
|
|
567
|
-
@pandas_udf("float", PandasUDFType.GROUPED_AGG)
|
|
568
|
-
def mean(x):
|
|
569
|
-
return np.mean(x)
|
|
570
|
-
|
|
571
|
-
df = self.spark.createDataFrame([Row(id=1, foo=42), Row(id=2, foo=1), Row(id=2, foo=2)])
|
|
572
|
-
|
|
573
|
-
agg = df.groupBy("id").agg(mean("foo").alias("mean"))
|
|
574
|
-
filtered = agg.filter(agg["mean"] > 40.0)
|
|
575
|
-
|
|
576
|
-
assert filtered.collect()[0]["mean"] == 42.0
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
class GroupedAggPandasUDFTests(GroupedAggPandasUDFTestsMixin, ReusedSQLTestCase):
|
|
580
|
-
pass
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
if __name__ == "__main__":
|
|
584
|
-
from pyspark.sql.tests.pandas.test_pandas_udf_grouped_agg import * # noqa: F401
|
|
585
|
-
|
|
586
|
-
try:
|
|
587
|
-
import xmlrunner
|
|
588
|
-
|
|
589
|
-
testRunner = xmlrunner.XMLTestRunner(output="target/test-reports", verbosity=2)
|
|
590
|
-
except ImportError:
|
|
591
|
-
testRunner = None
|
|
592
|
-
unittest.main(testRunner=testRunner, verbosity=2)
|