timeplus 2.0.0b1__tar.gz → 2.0.0b3__tar.gz
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.
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/PKG-INFO +1 -1
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/api_client.py +10 -1
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/stream.py +1 -1
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_analyze.py +2 -2
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_dbapi.py +13 -16
- timeplus-2.0.0b3/test/test_env.py +25 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_external_stream.py +10 -1
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_ingest_stream.py +27 -49
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_query.py +16 -16
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_sink.py +2 -1
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_source.py +2 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_sqlalchemy_query.py +60 -40
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/dbapi.py +31 -6
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/env.py +26 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/stream.py +3 -2
- timeplus-2.0.0b3/timeplus/version.py +1 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus.egg-info/PKG-INFO +1 -1
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus.egg-info/SOURCES.txt +241 -0
- timeplus-2.0.0b1/test/test_env.py +0 -41
- timeplus-2.0.0b1/timeplus/version.py +0 -1
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/README.md +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/setup.cfg +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/setup.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/__init__.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/configuration.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/__init__.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/alert.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/alert_incident.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/alert_timeline.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/analyze_sql_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/api_key.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/batching_policy.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/build.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/column.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/column_def.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/columns_resp.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/create_alert_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/create_api_key_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/create_api_key_response.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/create_dashboard_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/create_query_request_v1_beta2.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/create_saved_query_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/create_sink_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/create_source_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/create_view_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/customer.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/dashboard_dashboard.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/dashboard_panel.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/edge.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/error_response.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/event.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/event_infer_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/event_infer_response.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/execute_query_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/external_stream.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/external_stream_def.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/external_table.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/external_table_def.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/format_query_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/format_query_response.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/global_metrics_result.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/graph.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/info.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/ingest_data.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/invitation.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/invitation_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/kafka_common.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/kafka_common_tls.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/keygen_license.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/license_license.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/node.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/owner.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/payment.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/query.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/query_pipeline.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/query_pipeline_edge.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/query_pipeline_node.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/query_pipeline_node_metric.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/query_result.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/saved_query.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/schema_resp.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/sink.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/sink_stat.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/sink_stats.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/source.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/source_preview_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/sql_analyze_column.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/sql_analyze_result.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/stats.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/stats_error.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/stats_throughput.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/stream_def.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/stream_match_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/stream_setting.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/stream_stats.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/subscription.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/time_columns.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/udf.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/udf_argument.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/udf_auth_context.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/update_dashboard_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/update_source_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/update_stream_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/update_view_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/update_workspace_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/v1beta2_create_schema_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/v1beta2_licenses_body.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/v1beta2_list_kafka_topic_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/v1beta2_update_schema_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/view.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/workspace.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/models/workspace_settings.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/rest.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/__init__.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/alerts_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/api_keys_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/dashboards_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/external_streams_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/external_tables_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/invitations_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/license_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/metrics_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/misc_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/queries_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/saved_queries_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/schemas_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/sinks_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/sources_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/streams_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/subscription_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/topology_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/udfs_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/views_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/workspace_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_client/timeplus/workspaces_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/__init__.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_alert.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_alert_incident.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_alert_timeline.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_alerts_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_analyze_sql_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_api_key.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_api_keys_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_batching_policy.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_build.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_column.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_column_def.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_columns_resp.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_create_alert_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_create_api_key_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_create_api_key_response.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_create_dashboard_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_create_query_request_v1_beta2.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_create_saved_query_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_create_sink_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_create_source_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_create_view_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_customer.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_dashboard_dashboard.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_dashboard_panel.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_dashboards_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_edge.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_error_response.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_event.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_event_infer_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_event_infer_response.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_execute_query_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_external_stream.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_external_stream_def.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_external_streams_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_external_table.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_external_table_def.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_external_tables_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_format_query_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_format_query_response.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_global_metrics_result.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_graph.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_info.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_ingest_data.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_invitation.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_invitation_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_invitations_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_kafka_common.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_kafka_common_tls.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_keygen_license.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_license_license.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_license_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_metrics_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_misc_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_node.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_owner.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_payment.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_queries_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_query.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_query_pipeline.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_query_pipeline_edge.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_query_pipeline_node.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_query_pipeline_node_metric.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_query_result.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_saved_queries_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_saved_query.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_schema_resp.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_schemas_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_sink.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_sink_stat.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_sink_stats.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_sinks_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_source.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_source_preview_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_sources_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_sql_analyze_column.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_sql_analyze_result.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_stats.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_stats_error.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_stats_throughput.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_stream.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_stream_def.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_stream_match_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_stream_setting.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_stream_stats.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_streams_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_subscription.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_subscription_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_time_columns.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_topology_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_udf.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_udf_argument.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_udf_auth_context.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_udfs_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_update_dashboard_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_update_source_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_update_stream_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_update_view_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_update_workspace_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_v1beta2_create_schema_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_v1beta2_licenses_body.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_v1beta2_list_kafka_topic_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_v1beta2_update_schema_request.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_view.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_views_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_workspace.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_workspace_settings.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_workspace_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/swagger_test/test_workspaces_v1beta2_api.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_alert.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_dashboard.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_schema.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_sqlalchemy_types.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_stream.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_topology.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_udf.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/test/test_view.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/__init__.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/alert.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/dashboard.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/error.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/external_stream.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/query.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/schema.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/sink.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/source.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/sqlalchemy.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/topology.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/type.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/udf.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus/view.py +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus.egg-info/dependency_links.txt +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus.egg-info/requires.txt +0 -0
- {timeplus-2.0.0b1 → timeplus-2.0.0b3}/timeplus.egg-info/top_level.txt +0 -0
|
@@ -17,6 +17,7 @@ from multiprocessing.pool import ThreadPool
|
|
|
17
17
|
import os
|
|
18
18
|
import re
|
|
19
19
|
import tempfile
|
|
20
|
+
import base64
|
|
20
21
|
|
|
21
22
|
# python 2 and python 3 compatibility library
|
|
22
23
|
import six
|
|
@@ -75,7 +76,10 @@ class ApiClient(object):
|
|
|
75
76
|
self.user_agent = 'Swagger-Codegen/1.0.0/python'
|
|
76
77
|
|
|
77
78
|
def __del__(self):
|
|
78
|
-
|
|
79
|
+
try: # TODO: skip close exection
|
|
80
|
+
self.pool.close()
|
|
81
|
+
except Exception:
|
|
82
|
+
pass
|
|
79
83
|
self.pool.join()
|
|
80
84
|
|
|
81
85
|
@property
|
|
@@ -134,6 +138,10 @@ class ApiClient(object):
|
|
|
134
138
|
post_params = self.parameters_to_tuples(post_params,
|
|
135
139
|
collection_formats)
|
|
136
140
|
|
|
141
|
+
if self.configuration.username and self.configuration.password:
|
|
142
|
+
auth_header = f"{self.configuration.username}:{self.configuration.password}"
|
|
143
|
+
header_params['Authorization'] = 'Basic ' + base64.b64encode(auth_header.encode()).decode()
|
|
144
|
+
|
|
137
145
|
# auth setting
|
|
138
146
|
self.update_params_for_auth(header_params, query_params, auth_settings)
|
|
139
147
|
|
|
@@ -312,6 +320,7 @@ class ApiClient(object):
|
|
|
312
320
|
If parameter async_req is False or missing,
|
|
313
321
|
then the method will return the response directly.
|
|
314
322
|
"""
|
|
323
|
+
|
|
315
324
|
if not async_req:
|
|
316
325
|
return self.__call_api(resource_path, method,
|
|
317
326
|
path_params, query_params, header_params,
|
|
@@ -351,7 +351,7 @@ class Stream(object):
|
|
|
351
351
|
"""
|
|
352
352
|
if mode is None:
|
|
353
353
|
raise ValueError("Invalid value for `mode`, must not be `None`") # noqa: E501
|
|
354
|
-
allowed_values = ["append", "changelog", "changelog_kv", "versioned_kv"] # noqa: E501
|
|
354
|
+
allowed_values = ["append", "changelog", "changelog_kv", "versioned_kv", ""] # noqa: E501
|
|
355
355
|
if mode not in allowed_values:
|
|
356
356
|
raise ValueError(
|
|
357
357
|
"Invalid value for `mode` ({0}), must be one of {1}" # noqa: E501
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from timeplus import Query
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
def test_analyze(test_environment):
|
|
4
|
+
def test_analyze(test_environment, test_stream):
|
|
5
5
|
result = (
|
|
6
6
|
Query(env=test_environment)
|
|
7
|
-
.sql(query=f"SELECT * FROM
|
|
7
|
+
.sql(query=f"SELECT * FROM test_stream")
|
|
8
8
|
.analyze()
|
|
9
9
|
)
|
|
10
10
|
|
|
@@ -1,34 +1,31 @@
|
|
|
1
|
-
def test_dbapi_table(conn):
|
|
2
|
-
cursor = conn.execute("select * from table(
|
|
1
|
+
def test_dbapi_table(conn, test_stream):
|
|
2
|
+
cursor = conn.execute("select * from table(test_stream)")
|
|
3
3
|
next_result = cursor.next()
|
|
4
4
|
row1 = cursor.fetchone()
|
|
5
|
-
rows = cursor.fetchmany(3)
|
|
6
|
-
cursor_2 = conn.execute("select 1<>2")
|
|
7
|
-
query_result = list(cursor_2)
|
|
8
|
-
|
|
9
5
|
assert next_result is not None
|
|
10
6
|
assert row1 is not None
|
|
11
|
-
|
|
7
|
+
|
|
8
|
+
rows = cursor.fetchmany(2)
|
|
9
|
+
assert len(rows) == 2
|
|
10
|
+
|
|
11
|
+
cursor_2 = conn.execute("select 1<>2")
|
|
12
|
+
query_result = list(cursor_2)
|
|
12
13
|
assert len(query_result) == 1
|
|
13
14
|
|
|
14
15
|
|
|
15
|
-
def test_dbapi_live(conn):
|
|
16
|
-
cursor = conn.execute("select * from
|
|
16
|
+
def test_dbapi_live(conn, test_stream):
|
|
17
|
+
cursor = conn.execute("select * from test_stream where _tp_time > earliest_ts()")
|
|
17
18
|
next_result = cursor.next()
|
|
18
19
|
row1 = cursor.fetchone()
|
|
19
|
-
rows = cursor.fetchmany(
|
|
20
|
-
cursor_2 = conn.execute("select 1<>2")
|
|
21
|
-
query_result = list(cursor_2)
|
|
20
|
+
rows = cursor.fetchmany(2)
|
|
22
21
|
|
|
23
22
|
assert next_result is not None
|
|
24
23
|
assert row1 is not None
|
|
25
|
-
assert len(rows) ==
|
|
26
|
-
assert len(query_result) == 1
|
|
24
|
+
assert len(rows) == 2
|
|
27
25
|
|
|
28
26
|
|
|
29
|
-
def test_dbapi_show_streams(conn):
|
|
27
|
+
def test_dbapi_show_streams(conn, test_stream):
|
|
30
28
|
cursor = conn.execute("show streams")
|
|
31
|
-
cursor.next()
|
|
32
29
|
row = cursor.fetchone()
|
|
33
30
|
|
|
34
31
|
assert row is not None
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import re
|
|
3
|
+
|
|
4
|
+
import pytest
|
|
5
|
+
from timeplus.env import Environment
|
|
6
|
+
WORKSPACE_LEN = 8
|
|
7
|
+
APIKEY_LEN = 60
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def test_apikey_with_valid_key(test_environment):
|
|
11
|
+
env = test_environment
|
|
12
|
+
if os.environ.get("TIMEPLUS_API_KEY") is not None:
|
|
13
|
+
assert env._configuration.api_key["X-Api-Key"] == os.environ.get("TIMEPLUS_API_KEY")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def test_apikey_with_invalid_key():
|
|
17
|
+
if os.environ.get("TIMEPLUS_API_KEY") is not None:
|
|
18
|
+
env = Environment()
|
|
19
|
+
with pytest.raises(ValueError, match=f"The apikey should be {APIKEY_LEN} characters"):
|
|
20
|
+
env.apikey("invalid_key")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def test_workspace_with_valid_name(test_environment):
|
|
24
|
+
env = test_environment
|
|
25
|
+
assert env._workspace == os.environ.get("TIMEPLUS_WORKSPACE")
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import os
|
|
1
2
|
from timeplus import ExternalStream
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
def test_external_stream(test_environment):
|
|
5
6
|
name = "gluon_test_external_name"
|
|
6
7
|
|
|
8
|
+
external_stream_password = os.environ.get("EXTERNAL_STREAM_PASSWORD")
|
|
9
|
+
|
|
7
10
|
# Create a new stream instance with the given name
|
|
8
11
|
stream = ExternalStream(env=test_environment).name(name)
|
|
9
12
|
|
|
@@ -19,7 +22,13 @@ def test_external_stream(test_environment):
|
|
|
19
22
|
.name(name)
|
|
20
23
|
.add_column("raw", "string")
|
|
21
24
|
.add_settings("type", "kafka")
|
|
22
|
-
.add_settings("brokers", "kafka.
|
|
25
|
+
.add_settings("brokers", "kafka-public-read-timeplus.a.aivencloud.com:28864")
|
|
26
|
+
.add_settings("security_protocol", "SASL_SSL")
|
|
27
|
+
.add_settings("sasl_mechanism", "SCRAM-SHA-256")
|
|
28
|
+
.add_settings("username", "readonly")
|
|
29
|
+
.add_settings("password", external_stream_password)
|
|
30
|
+
.add_settings("skip_ssl_cert_check", "1")
|
|
31
|
+
|
|
23
32
|
.add_settings("topic", "car_live_data")
|
|
24
33
|
.create()
|
|
25
34
|
)
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import time
|
|
3
|
-
|
|
3
|
+
import os
|
|
4
4
|
import pytest
|
|
5
|
+
|
|
5
6
|
from timeplus import Stream, Query
|
|
6
7
|
import datetime
|
|
7
8
|
|
|
8
9
|
time_wait = 5
|
|
9
10
|
|
|
11
|
+
|
|
10
12
|
def test_ingest(test_environment, test_stream):
|
|
11
|
-
# there is
|
|
13
|
+
# there is 4 row data in test stream already
|
|
12
14
|
time.sleep(time_wait)
|
|
13
15
|
# wait previous data ingested
|
|
14
16
|
data = [["time", "data"], [[1, "efgh"]]]
|
|
@@ -29,33 +31,22 @@ def test_ingest(test_environment, test_stream):
|
|
|
29
31
|
for event in query.result():
|
|
30
32
|
if event.event == "message":
|
|
31
33
|
results.extend(json.loads(event.data))
|
|
32
|
-
print(results)
|
|
33
34
|
|
|
35
|
+
result_length = len(results)
|
|
34
36
|
assert len(results) > 1, "No data returned from the stream"
|
|
35
|
-
assert results[1][0] == 1, "Returned time does not match the ingested integer"
|
|
36
|
-
assert results[1][1] == 'efgh', "Returned data does not match the ingested string"
|
|
37
|
+
assert results[result_length-1][0] == 1, "Returned time does not match the ingested integer"
|
|
38
|
+
assert results[result_length-1][1] == 'efgh', "Returned data does not match the ingested string"
|
|
37
39
|
|
|
38
40
|
query.delete()
|
|
39
41
|
|
|
40
42
|
|
|
41
|
-
def test_stream_ingest_lines(test_environment,
|
|
42
|
-
test_stream.delete()
|
|
43
|
-
|
|
44
|
-
stream = (
|
|
45
|
-
Stream(env=test_environment)
|
|
46
|
-
.name("test_stream")
|
|
47
|
-
.column("raw", "string")
|
|
48
|
-
.replication_factor(3)
|
|
49
|
-
.shards(3)
|
|
50
|
-
.create()
|
|
51
|
-
)
|
|
52
|
-
time.sleep(time_wait)
|
|
43
|
+
def test_stream_ingest_lines(test_environment, test_stream_raw):
|
|
53
44
|
|
|
54
45
|
payload = '{"time":1,"data":"abcd"}\n{"time":2,"data":"xyz"}'
|
|
55
46
|
|
|
56
47
|
# Ingest data in 'lines' format
|
|
57
48
|
try:
|
|
58
|
-
|
|
49
|
+
test_stream_raw.ingest(payload=payload, format="lines")
|
|
59
50
|
except Exception as e:
|
|
60
51
|
pytest.fail(f"Ingest lines method failed with exception {e}")
|
|
61
52
|
|
|
@@ -63,45 +54,31 @@ def test_stream_ingest_lines(test_environment,test_stream):
|
|
|
63
54
|
|
|
64
55
|
query = (
|
|
65
56
|
Query(env=test_environment)
|
|
66
|
-
.sql(query="SELECT * FROM table(
|
|
57
|
+
.sql(query="SELECT * FROM table(test_stream_raw)")
|
|
67
58
|
.create()
|
|
68
59
|
)
|
|
69
60
|
results = []
|
|
70
61
|
for event in query.result():
|
|
71
62
|
if event.event == "message":
|
|
72
63
|
results.extend(json.loads(event.data))
|
|
73
|
-
|
|
74
|
-
|
|
64
|
+
|
|
65
|
+
result_length = len(results)
|
|
75
66
|
|
|
76
67
|
assert len(results) > 1, "No data returned from the stream"
|
|
77
|
-
assert results[
|
|
78
|
-
assert results[1][0] == '{"time":2,"data":"xyz"}', "Returned data does not match the ingested data"
|
|
68
|
+
assert results[result_length-2][0] == '{"time":1,"data":"abcd"}', "Returned data does not match the ingested data"
|
|
69
|
+
assert results[result_length-1][0] == '{"time":2,"data":"xyz"}', "Returned data does not match the ingested data"
|
|
79
70
|
|
|
80
71
|
query.delete()
|
|
81
72
|
|
|
82
|
-
|
|
83
|
-
def test_stream_ingest_raw(test_environment,test_stream):
|
|
84
|
-
test_stream.delete()
|
|
85
|
-
|
|
73
|
+
def test_stream_ingest_raw(test_environment, test_stream_raw):
|
|
86
74
|
payload = """
|
|
87
75
|
{"a":1,"b":"world"}
|
|
88
76
|
{"a":2,"b":"hello"}
|
|
89
77
|
"""
|
|
90
78
|
|
|
91
|
-
stream = (
|
|
92
|
-
Stream(env=test_environment)
|
|
93
|
-
.name("test_stream")
|
|
94
|
-
.column("raw", "string")
|
|
95
|
-
.replication_factor(3)
|
|
96
|
-
.shards(3)
|
|
97
|
-
.create()
|
|
98
|
-
)
|
|
99
|
-
|
|
100
|
-
time.sleep(time_wait)
|
|
101
|
-
|
|
102
79
|
# Ingest data in 'raw' format
|
|
103
80
|
try:
|
|
104
|
-
|
|
81
|
+
test_stream_raw.ingest(payload=payload, format="raw")
|
|
105
82
|
except Exception as e:
|
|
106
83
|
pytest.fail(f"Ingest raw method failed with exception {e}")
|
|
107
84
|
|
|
@@ -109,24 +86,23 @@ def test_stream_ingest_raw(test_environment,test_stream):
|
|
|
109
86
|
|
|
110
87
|
query = (
|
|
111
88
|
Query(env=test_environment)
|
|
112
|
-
.sql(query="SELECT * FROM table(
|
|
89
|
+
.sql(query="SELECT * FROM table(test_stream_raw)")
|
|
113
90
|
.create()
|
|
114
91
|
)
|
|
115
92
|
results = []
|
|
116
93
|
for event in query.result():
|
|
117
94
|
if event.event == "message":
|
|
118
95
|
results.extend(json.loads(event.data))
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
96
|
+
|
|
97
|
+
result_length = len(results)
|
|
122
98
|
assert results is not None, "No data returned from the stream"
|
|
123
|
-
assert results[
|
|
99
|
+
assert results[result_length-1][0] == payload, "Returned data does not match the ingested data"
|
|
124
100
|
|
|
125
101
|
query.delete()
|
|
126
102
|
|
|
127
103
|
|
|
128
104
|
def test_json_ingest(test_environment, test_stream):
|
|
129
|
-
# there is
|
|
105
|
+
# there is 4 row data in test stream already
|
|
130
106
|
time.sleep(time_wait)
|
|
131
107
|
# wait previous data ingested
|
|
132
108
|
payload = """
|
|
@@ -151,12 +127,14 @@ def test_json_ingest(test_environment, test_stream):
|
|
|
151
127
|
for event in query.result():
|
|
152
128
|
if event.event == "message":
|
|
153
129
|
results.extend(json.loads(event.data))
|
|
130
|
+
|
|
154
131
|
print(results)
|
|
155
132
|
|
|
133
|
+
result_length = len(results)
|
|
156
134
|
assert len(results) > 1, "No data returned from the stream"
|
|
157
|
-
assert results[
|
|
158
|
-
assert results[
|
|
159
|
-
assert results[
|
|
160
|
-
assert results[
|
|
135
|
+
assert results[result_length-2][0] == 2, "Returned data does not match the ingested data"
|
|
136
|
+
assert results[result_length-2][1] == 'hello', "Returned data does not match the ingested data"
|
|
137
|
+
assert results[result_length-1][0] == 1, "Returned data does not match the ingested data"
|
|
138
|
+
assert results[result_length-1][1] == 'world', "Returned data does not match the ingested data"
|
|
161
139
|
|
|
162
140
|
query.delete()
|
|
@@ -8,7 +8,7 @@ def test_query_with_stream(test_environment, test_stream):
|
|
|
8
8
|
# Test the Query object with stream
|
|
9
9
|
query = (
|
|
10
10
|
Query(env=test_environment)
|
|
11
|
-
.sql(query=f"SELECT * FROM test_stream")
|
|
11
|
+
.sql(query=f"SELECT * FROM test_stream where _tp_time > earliest_ts()")
|
|
12
12
|
.create()
|
|
13
13
|
)
|
|
14
14
|
|
|
@@ -22,6 +22,19 @@ def test_query_with_stream(test_environment, test_stream):
|
|
|
22
22
|
assert "sql" in metadata
|
|
23
23
|
assert "id" in metadata
|
|
24
24
|
|
|
25
|
+
limit = 1
|
|
26
|
+
count = 0
|
|
27
|
+
|
|
28
|
+
results = []
|
|
29
|
+
for event in query.result():
|
|
30
|
+
if event.event == "message":
|
|
31
|
+
results.extend(json.loads(event.data))
|
|
32
|
+
count += 1
|
|
33
|
+
if count >= limit:
|
|
34
|
+
break
|
|
35
|
+
|
|
36
|
+
assert len(results) >= 4 # there are records from ingest test
|
|
37
|
+
|
|
25
38
|
query.cancel()
|
|
26
39
|
# Without query.cancel(), there will be an error:
|
|
27
40
|
# OSError: [Errno 9] Bad file descriptor And the query cannot be deleted
|
|
@@ -32,30 +45,17 @@ def test_query_with_stream(test_environment, test_stream):
|
|
|
32
45
|
|
|
33
46
|
|
|
34
47
|
def test_query_with_table(test_environment, test_stream):
|
|
35
|
-
#Test the Query Object with history table
|
|
36
|
-
data = [["time", "data"], [[1, "efgh"]]]
|
|
37
|
-
test_stream.ingest(*data)
|
|
38
|
-
|
|
39
48
|
time.sleep(3)
|
|
40
|
-
|
|
41
|
-
# FAILED test_query.py::test_query_with_table - KeyError: 'id'
|
|
42
|
-
|
|
49
|
+
|
|
43
50
|
query = (
|
|
44
51
|
Query(env=test_environment)
|
|
45
52
|
.sql(query="SELECT * FROM table(test_stream)")
|
|
46
53
|
.create()
|
|
47
54
|
)
|
|
48
55
|
|
|
49
|
-
limit = 2
|
|
50
|
-
count = 0
|
|
51
|
-
|
|
52
56
|
results = []
|
|
53
57
|
for event in query.result():
|
|
54
58
|
if event.event == "message":
|
|
55
59
|
results.extend(json.loads(event.data))
|
|
56
|
-
|
|
57
|
-
if count >= limit:
|
|
58
|
-
break
|
|
59
|
-
print(results)
|
|
60
|
-
assert len(results) == 2
|
|
60
|
+
assert len(results) >= 4 # there are records from ingest test
|
|
61
61
|
query.delete()
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import pytest
|
|
1
2
|
from timeplus import Source, Stream
|
|
2
3
|
|
|
3
4
|
|
|
@@ -50,6 +51,7 @@ def test_source_generator(test_environment):
|
|
|
50
51
|
assert not Source(env=test_environment).id(source_id).exist()
|
|
51
52
|
|
|
52
53
|
|
|
54
|
+
@pytest.mark.skipif(reason="Skipping this test due to kafka source move to external stream")
|
|
53
55
|
def test_source_kafka(test_environment):
|
|
54
56
|
stream_name = "test_kafka"
|
|
55
57
|
source_name = "test_kafka"
|
|
@@ -1,43 +1,42 @@
|
|
|
1
1
|
import time
|
|
2
|
+
import pytest
|
|
2
3
|
from sqlalchemy import text, select, MetaData, Table
|
|
4
|
+
from datetime import timedelta
|
|
3
5
|
from timeplus import View
|
|
4
6
|
|
|
5
7
|
|
|
6
|
-
def test_driver_sql(engine):
|
|
8
|
+
def test_driver_sql(engine, test_stream):
|
|
7
9
|
with engine.connect() as conn:
|
|
8
10
|
result = conn.exec_driver_sql(
|
|
9
|
-
"select
|
|
10
|
-
assert len(result.fetchall()) ==
|
|
11
|
+
"select * from table(test_stream) limit 2")
|
|
12
|
+
assert len(result.fetchall()) == 2
|
|
11
13
|
|
|
12
14
|
|
|
13
|
-
def test_driver_sql_live(engine):
|
|
15
|
+
def test_driver_sql_live(engine, test_stream):
|
|
14
16
|
with engine.connect() as conn:
|
|
15
17
|
result = conn.exec_driver_sql(
|
|
16
|
-
"select
|
|
17
|
-
assert len(result.fetchall()) ==
|
|
18
|
+
"select * from test_stream where _tp_time > earliest_ts() limit 2")
|
|
19
|
+
assert len(result.fetchall()) == 2
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
def test_text_sql(engine):
|
|
21
|
+
def test_text_sql(engine, test_stream):
|
|
21
22
|
with engine.connect() as connection:
|
|
22
23
|
result = connection.execute(
|
|
23
|
-
text("select * from table(
|
|
24
|
+
text("select * from table(test_stream) limit 3"))
|
|
24
25
|
rows = [row for row in result]
|
|
25
26
|
assert len(rows) == 3
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
def test_text_sql_live(engine):
|
|
28
|
+
def test_text_sql_live(engine, test_stream):
|
|
29
29
|
with engine.connect() as connection:
|
|
30
30
|
result = connection.execute(
|
|
31
|
-
text("select * from
|
|
31
|
+
text("select * from test_stream where _tp_time > earliest_ts() limit 3"))
|
|
32
32
|
rows = [row for row in result]
|
|
33
33
|
assert len(rows) == 3
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
def test_text_streaming_sql(engine):
|
|
35
|
+
def test_text_streaming_sql(engine, test_stream):
|
|
37
36
|
with engine.connect() as connection:
|
|
38
|
-
result = connection.execute(text("select * from
|
|
37
|
+
result = connection.execute(text("select * from test_stream where _tp_time > earliest_ts()"))
|
|
39
38
|
count = 0
|
|
40
|
-
max =
|
|
39
|
+
max = 3
|
|
41
40
|
for row in result:
|
|
42
41
|
assert row is not None
|
|
43
42
|
count += 1
|
|
@@ -45,21 +44,18 @@ def test_text_streaming_sql(engine):
|
|
|
45
44
|
break
|
|
46
45
|
assert count == max
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
table_name = "car_live_data"
|
|
47
|
+
def test_check_stream_existence(engine, test_stream):
|
|
48
|
+
table_name = "test_stream"
|
|
51
49
|
with engine.connect() as conn:
|
|
52
50
|
table_exists = engine.dialect.has_table(conn, table_name)
|
|
53
51
|
assert table_exists
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
def test_table_names(engine):
|
|
53
|
+
def test_table_names(engine, test_stream):
|
|
57
54
|
with engine.connect() as conn:
|
|
58
55
|
tables = engine.dialect.get_table_names(conn)
|
|
59
|
-
assert "
|
|
60
|
-
|
|
56
|
+
assert "test_stream" in tables
|
|
61
57
|
|
|
62
|
-
def test_view_names(test_environment, engine):
|
|
58
|
+
def test_view_names(test_environment, engine, test_stream):
|
|
63
59
|
view_name = "example_mv"
|
|
64
60
|
view = View(env=test_environment).name(view_name)
|
|
65
61
|
|
|
@@ -84,7 +80,6 @@ def test_view_names(test_environment, engine):
|
|
|
84
80
|
|
|
85
81
|
view.delete()
|
|
86
82
|
|
|
87
|
-
|
|
88
83
|
def test_materialized_view_names(engine,test_environment,test_stream):
|
|
89
84
|
view_name = "example_mv"
|
|
90
85
|
view = View(env=test_environment).name(view_name)
|
|
@@ -108,30 +103,55 @@ def test_materialized_view_names(engine,test_environment,test_stream):
|
|
|
108
103
|
|
|
109
104
|
view.delete()
|
|
110
105
|
|
|
106
|
+
def test_view_reflection(test_environment, engine, test_stream):
|
|
107
|
+
view_name = "test_view"
|
|
108
|
+
view = View(env=test_environment).name(view_name)
|
|
111
109
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
column_names = [c.name for c in car_view.columns]
|
|
117
|
-
assert "speed_kmh" in column_names
|
|
110
|
+
try:
|
|
111
|
+
view.delete()
|
|
112
|
+
except Exception:
|
|
113
|
+
pass
|
|
118
114
|
|
|
115
|
+
view = (
|
|
116
|
+
View(env=test_environment)
|
|
117
|
+
.name(view_name)
|
|
118
|
+
.query("select * from test_stream")
|
|
119
|
+
.create()
|
|
120
|
+
)
|
|
119
121
|
|
|
120
|
-
|
|
122
|
+
time.sleep(1)
|
|
121
123
|
metadata_obj = MetaData()
|
|
122
|
-
|
|
123
|
-
assert
|
|
124
|
-
column_names = [c.name for c in
|
|
125
|
-
assert "
|
|
124
|
+
test_view = Table("test_view", metadata_obj, autoload_with=engine)
|
|
125
|
+
assert test_view is not None
|
|
126
|
+
column_names = [c.name for c in test_view.columns]
|
|
127
|
+
assert "time" in column_names
|
|
128
|
+
assert "data" in column_names
|
|
126
129
|
|
|
130
|
+
view.delete()
|
|
131
|
+
time.sleep(3)
|
|
132
|
+
|
|
133
|
+
def test_table_reflection(engine, test_stream):
|
|
134
|
+
metadata_obj = MetaData()
|
|
135
|
+
test_table = Table("test_stream", metadata_obj, autoload_with=engine)
|
|
136
|
+
assert test_table is not None
|
|
137
|
+
column_names = [c.name for c in test_table.columns]
|
|
138
|
+
assert "time" in column_names
|
|
139
|
+
assert "data" in column_names
|
|
127
140
|
|
|
128
|
-
def test_select_query(engine):
|
|
141
|
+
def test_select_query(engine, test_stream):
|
|
129
142
|
metadata_obj = MetaData()
|
|
130
|
-
|
|
131
|
-
|
|
143
|
+
test_table = Table("test_stream", metadata_obj, autoload_with=engine)
|
|
144
|
+
one_hour_ago = text("now() - 1h")
|
|
145
|
+
stmt = select(test_table).where(
|
|
146
|
+
test_table.c._tp_time > one_hour_ago,
|
|
147
|
+
test_table.c.time > 1
|
|
148
|
+
)
|
|
149
|
+
compiled_query = stmt.compile(compile_kwargs={"literal_binds": True})
|
|
150
|
+
print(f"compiled_query {compiled_query}")
|
|
151
|
+
|
|
132
152
|
with engine.connect() as conn:
|
|
133
153
|
count = 0
|
|
134
|
-
max =
|
|
154
|
+
max = 2
|
|
135
155
|
for row in conn.execute(stmt):
|
|
136
156
|
assert row is not None
|
|
137
157
|
count += 1
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import os
|
|
1
2
|
import json
|
|
2
3
|
import re
|
|
3
4
|
import itertools
|
|
@@ -84,16 +85,24 @@ def connect(
|
|
|
84
85
|
Connection: A Connection object.
|
|
85
86
|
"""
|
|
86
87
|
address = f"{scheme}://{host}:{port}"
|
|
87
|
-
apikey = password
|
|
88
88
|
workspace = path
|
|
89
|
-
|
|
89
|
+
if user is not None and password is not None:
|
|
90
|
+
return Connection(address, None, workspace, user, password)
|
|
91
|
+
else:
|
|
92
|
+
apikey = password
|
|
93
|
+
return Connection(address, apikey, workspace, None, None)
|
|
90
94
|
|
|
91
95
|
|
|
92
96
|
class Connection(object):
|
|
93
97
|
"""Connection to a Timeplus workspace."""
|
|
94
98
|
|
|
95
99
|
def __init__(
|
|
96
|
-
self,
|
|
100
|
+
self,
|
|
101
|
+
address="https://us.timeplus.cloud",
|
|
102
|
+
apikey=None,
|
|
103
|
+
workspace=None,
|
|
104
|
+
username=None,
|
|
105
|
+
password=None,
|
|
97
106
|
):
|
|
98
107
|
"""
|
|
99
108
|
Constructor for the Connection class.
|
|
@@ -102,8 +111,24 @@ class Connection(object):
|
|
|
102
111
|
address: String - Server address. Default is "https://us.timeplus.cloud".
|
|
103
112
|
apikey: String - API key for the connection. Default is None.
|
|
104
113
|
workspace: String - Workspace for the connection. Default is None.
|
|
114
|
+
username: String - username for the connection. Default is None.
|
|
115
|
+
password: String - password for the connection. Default is None.
|
|
105
116
|
"""
|
|
106
|
-
|
|
117
|
+
|
|
118
|
+
if os.environ.get("TIMEPLUS_SQLALCHEMY_SCHEMA") == "http":
|
|
119
|
+
address = address.replace("https://", "http://")
|
|
120
|
+
|
|
121
|
+
self.env = Environment().address(address).workspace(workspace)
|
|
122
|
+
|
|
123
|
+
if apikey is not None:
|
|
124
|
+
self.env.apikey(apikey)
|
|
125
|
+
|
|
126
|
+
if username is not None:
|
|
127
|
+
self.env.username(username)
|
|
128
|
+
|
|
129
|
+
if password is not None:
|
|
130
|
+
self.env.password(password)
|
|
131
|
+
|
|
107
132
|
self.closed = False
|
|
108
133
|
self.cursors = []
|
|
109
134
|
|
|
@@ -161,14 +186,14 @@ class Connection(object):
|
|
|
161
186
|
def _get_table(self, name):
|
|
162
187
|
try:
|
|
163
188
|
return Stream(env=self.env).name(name).get()
|
|
164
|
-
except:
|
|
189
|
+
except: # noqa: E722
|
|
165
190
|
return ExternalStream(env=self.env).name(name).get()
|
|
166
191
|
|
|
167
192
|
def _get_view(self, name):
|
|
168
193
|
return View(env=self.env).name(name).get()
|
|
169
194
|
|
|
170
195
|
def _list_table(self):
|
|
171
|
-
streams =
|
|
196
|
+
streams = Stream(env=self.env).list()
|
|
172
197
|
estreams = ExternalStream(env=self.env).list()
|
|
173
198
|
|
|
174
199
|
return streams + estreams
|