|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "id": "cbb6e02b-aa46-4143-96fc-1d3c9df1000d", |
| 6 | + "metadata": {}, |
| 7 | + "source": [ |
| 8 | + "## Error when running `gtfs_digest/merge_segment_data.py`\n", |
| 9 | + "`Traceback (most recent call last):\n", |
| 10 | + " File \"/opt/conda/lib/python3.11/site-packages/dask/dataframe/utils.py\", line 195, in raise_on_meta_error\n", |
| 11 | + " yield\n", |
| 12 | + " File \"/opt/conda/lib/python3.11/site-packages/dask/dataframe/core.py\", line 7175, in _emulate\n", |
| 13 | + " return func(*_extract_meta(args, True), **_extract_meta(kwargs, True))\n", |
| 14 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 15 | + " File \"/home/jovyan/data-analyses/_shared_utils/shared_utils/dask_utils.py\", line 134, in import_df_func\n", |
| 16 | + " df = pd.read_parquet(\n", |
| 17 | + " ^^^^^^^^^^^^^^^^\n", |
| 18 | + " File \"/opt/conda/lib/python3.11/site-packages/pandas/io/parquet.py\", line 503, in read_parquet\n", |
| 19 | + " return impl.read(\n", |
| 20 | + " ^^^^^^^^^^\n", |
| 21 | + " File \"/opt/conda/lib/python3.11/site-packages/pandas/io/parquet.py\", line 251, in read\n", |
| 22 | + " result = self.api.parquet.read_table(\n", |
| 23 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 24 | + " File \"/opt/conda/lib/python3.11/site-packages/pyarrow/parquet/core.py\", line 1793, in read_table\n", |
| 25 | + " dataset = ParquetDataset(\n", |
| 26 | + " ^^^^^^^^^^^^^^^\n", |
| 27 | + " File \"/opt/conda/lib/python3.11/site-packages/pyarrow/parquet/core.py\", line 1371, in __init__\n", |
| 28 | + " self._dataset = ds.dataset(path_or_paths, filesystem=filesystem,\n", |
| 29 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 30 | + " File \"/opt/conda/lib/python3.11/site-packages/pyarrow/dataset.py\", line 794, in dataset\n", |
| 31 | + " return _filesystem_dataset(source, **kwargs)\n", |
| 32 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 33 | + " File \"/opt/conda/lib/python3.11/site-packages/pyarrow/dataset.py\", line 476, in _filesystem_dataset\n", |
| 34 | + " fs, paths_or_selector = _ensure_single_source(source, filesystem)\n", |
| 35 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 36 | + " File \"/opt/conda/lib/python3.11/site-packages/pyarrow/dataset.py\", line 441, in _ensure_single_source\n", |
| 37 | + " raise FileNotFoundError(path)\n", |
| 38 | + "FileNotFoundError: calitp-analytics-data/data-analyses/rt_segment_speeds/rollup_singleday/speeds_route_dir_segments_2024-01-17.parquet\n", |
| 39 | + "\n", |
| 40 | + "The above exception was the direct cause of the following exception:\n", |
| 41 | + "\n", |
| 42 | + "Traceback (most recent call last):\n", |
| 43 | + " File \"/home/jovyan/data-analyses/gtfs_digest/merge_segment_data.py\", line 93, in <module>\n", |
| 44 | + " segment_speeds = concatenate_segment_speeds_by_route_direction(\n", |
| 45 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 46 | + " File \"/home/jovyan/data-analyses/gtfs_digest/merge_segment_data.py\", line 40, in concatenate_segment_speeds_by_route_direction\n", |
| 47 | + " df = time_series_utils.concatenate_datasets_across_dates(\n", |
| 48 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 49 | + " File \"/home/jovyan/data-analyses/rt_segment_speeds/segment_speed_utils/time_series_utils.py\", line 30, in concatenate_datasets_across_dates\n", |
| 50 | + " df = dask_utils.get_ddf(\n", |
| 51 | + " ^^^^^^^^^^^^^^^^^^^\n", |
| 52 | + " File \"/home/jovyan/data-analyses/_shared_utils/shared_utils/dask_utils.py\", line 183, in get_ddf\n", |
| 53 | + " ddf = dd.from_map(import_df_func, paths, date_list, data_type=data_type, **kwargs).drop_duplicates()\n", |
| 54 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 55 | + " File \"/opt/conda/lib/python3.11/site-packages/dask/dataframe/io/io.py\", line 1028, in from_map\n", |
| 56 | + " meta = _emulate(\n", |
| 57 | + " ^^^^^^^^^\n", |
| 58 | + " File \"/opt/conda/lib/python3.11/site-packages/dask/dataframe/core.py\", line 7174, in _emulate\n", |
| 59 | + " with raise_on_meta_error(funcname(func), udf=udf), check_numeric_only_deprecation():\n", |
| 60 | + " File \"/opt/conda/lib/python3.11/contextlib.py\", line 155, in __exit__\n", |
| 61 | + " self.gen.throw(typ, value, traceback)\n", |
| 62 | + " File \"/opt/conda/lib/python3.11/site-packages/dask/dataframe/utils.py\", line 216, in raise_on_meta_error\n", |
| 63 | + " raise ValueError(msg) from e\n", |
| 64 | + "ValueError: Metadata inference failed in `import_df_func`.\n", |
| 65 | + "\n", |
| 66 | + "You have supplied a custom function and Dask is unable to \n", |
| 67 | + "determine the type of output that that function returns. \n", |
| 68 | + "\n", |
| 69 | + "To resolve this please provide a meta= keyword.\n", |
| 70 | + "The docstring of the Dask function you ran should have more information.\n", |
| 71 | + "\n", |
| 72 | + "Original error is below:\n", |
| 73 | + "------------------------\n", |
| 74 | + "FileNotFoundError('calitp-analytics-data/data-analyses/rt_segment_speeds/rollup_singleday/speeds_route_dir_segments_2024-01-17.parquet')\n", |
| 75 | + "\n", |
| 76 | + "Traceback:\n", |
| 77 | + "---------\n", |
| 78 | + " File \"/opt/conda/lib/python3.11/site-packages/dask/dataframe/utils.py\", line 195, in raise_on_meta_error\n", |
| 79 | + " yield\n", |
| 80 | + " File \"/opt/conda/lib/python3.11/site-packages/dask/dataframe/core.py\", line 7175, in _emulate\n", |
| 81 | + " return func(*_extract_meta(args, True), **_extract_meta(kwargs, True))\n", |
| 82 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 83 | + " File \"/home/jovyan/data-analyses/_shared_utils/shared_utils/dask_utils.py\", line 134, in import_df_func\n", |
| 84 | + " df = pd.read_parquet(\n", |
| 85 | + " ^^^^^^^^^^^^^^^^\n", |
| 86 | + " File \"/opt/conda/lib/python3.11/site-packages/pandas/io/parquet.py\", line 503, in read_parquet\n", |
| 87 | + " return impl.read(\n", |
| 88 | + " ^^^^^^^^^^\n", |
| 89 | + " File \"/opt/conda/lib/python3.11/site-packages/pandas/io/parquet.py\", line 251, in read\n", |
| 90 | + " result = self.api.parquet.read_table(\n", |
| 91 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 92 | + " File \"/opt/conda/lib/python3.11/site-packages/pyarrow/parquet/core.py\", line 1793, in read_table\n", |
| 93 | + " dataset = ParquetDataset(\n", |
| 94 | + " ^^^^^^^^^^^^^^^\n", |
| 95 | + " File \"/opt/conda/lib/python3.11/site-packages/pyarrow/parquet/core.py\", line 1371, in __init__\n", |
| 96 | + " self._dataset = ds.dataset(path_or_paths, filesystem=filesystem,\n", |
| 97 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 98 | + " File \"/opt/conda/lib/python3.11/site-packages/pyarrow/dataset.py\", line 794, in dataset\n", |
| 99 | + " return _filesystem_dataset(source, **kwargs)\n", |
| 100 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 101 | + " File \"/opt/conda/lib/python3.11/site-packages/pyarrow/dataset.py\", line 476, in _filesystem_dataset\n", |
| 102 | + " fs, paths_or_selector = _ensure_single_source(source, filesystem)\n", |
| 103 | + " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n", |
| 104 | + " File \"/opt/conda/lib/python3.11/site-packages/pyarrow/dataset.py\", line 441, in _ensure_single_source\n", |
| 105 | + " raise FileNotFoundError(path)\n", |
| 106 | + "\n", |
| 107 | + "WARNING: All log messages before absl::InitializeLog() is called are written to STDERR\n", |
| 108 | + "E0000 00:00:1739983694.449132 625 init.cc:232] grpc_wait_for_shutdown_with_timeout() timed out.`" |
| 109 | + ] |
| 110 | + }, |
| 111 | + { |
| 112 | + "cell_type": "code", |
| 113 | + "execution_count": 1, |
| 114 | + "id": "3d70f4c3-3572-4d2e-b588-226709d48e25", |
| 115 | + "metadata": { |
| 116 | + "tags": [] |
| 117 | + }, |
| 118 | + "outputs": [], |
| 119 | + "source": [ |
| 120 | + "import _section1_utils as section1\n", |
| 121 | + "import geopandas as gpd\n", |
| 122 | + "import merge_data\n", |
| 123 | + "import merge_operator_data\n", |
| 124 | + "import numpy as np\n", |
| 125 | + "import pandas as pd\n", |
| 126 | + "from segment_speed_utils import gtfs_schedule_wrangling, helpers\n", |
| 127 | + "from shared_utils import portfolio_utils\n", |
| 128 | + "from update_vars import GTFS_DATA_DICT, RT_SCHED_GCS, SCHED_GCS, SEGMENT_GCS" |
| 129 | + ] |
| 130 | + }, |
| 131 | + { |
| 132 | + "cell_type": "code", |
| 133 | + "execution_count": 2, |
| 134 | + "id": "adfc13e3-098e-41e8-883a-497f85afbea5", |
| 135 | + "metadata": { |
| 136 | + "tags": [] |
| 137 | + }, |
| 138 | + "outputs": [], |
| 139 | + "source": [ |
| 140 | + "pd.options.display.max_columns = 100\n", |
| 141 | + "pd.options.display.float_format = \"{:.2f}\".format\n", |
| 142 | + "pd.set_option(\"display.max_rows\", None)\n", |
| 143 | + "pd.set_option(\"display.max_colwidth\", None)" |
| 144 | + ] |
| 145 | + }, |
| 146 | + { |
| 147 | + "cell_type": "code", |
| 148 | + "execution_count": 3, |
| 149 | + "id": "58095cec-ca10-40e4-9605-51626170f32a", |
| 150 | + "metadata": { |
| 151 | + "tags": [] |
| 152 | + }, |
| 153 | + "outputs": [], |
| 154 | + "source": [ |
| 155 | + "# FileNotFoundError: \n", |
| 156 | + "# calitp-analytics-data/data-analyses/rt_segment_speeds/rollup_singleday/speeds_route_dir_segments_2024-01-17.parquet\n", |
| 157 | + "# gs://calitp-analytics-data/data-analyses/rt_segment_speeds/rollup_singleday/speeds_route_dir_2024-01-17.parquet" |
| 158 | + ] |
| 159 | + } |
| 160 | + ], |
| 161 | + "metadata": { |
| 162 | + "kernelspec": { |
| 163 | + "display_name": "Python 3 (ipykernel)", |
| 164 | + "language": "python", |
| 165 | + "name": "python3" |
| 166 | + }, |
| 167 | + "language_info": { |
| 168 | + "codemirror_mode": { |
| 169 | + "name": "ipython", |
| 170 | + "version": 3 |
| 171 | + }, |
| 172 | + "file_extension": ".py", |
| 173 | + "mimetype": "text/x-python", |
| 174 | + "name": "python", |
| 175 | + "nbconvert_exporter": "python", |
| 176 | + "pygments_lexer": "ipython3", |
| 177 | + "version": "3.11.6" |
| 178 | + } |
| 179 | + }, |
| 180 | + "nbformat": 4, |
| 181 | + "nbformat_minor": 5 |
| 182 | +} |
0 commit comments