refactor: Use raw string in regex (#4016)

* refactor: Use raw string in regex

* np.NaN was removed in the NumPy 2.0

* Move default python version to 3.10

* Move back default python version to 3.9

* Remove version mistmatched tes notebooks
This commit is contained in:
Eric Dong
2025-04-28 19:54:44 +00:00
committed by GitHub
parent 49de587b2c
commit 5e2841384f
3 changed files with 2 additions and 4 deletions
@@ -238,7 +238,7 @@ def _get_notebook_python_version(notebook_path: str) -> str:
# Look for the python version specification pattern
re_match = re.search(
"python version = (\d+\.\d+)", markdown, flags=re.IGNORECASE
r"python version = (\d+\.\d+)", markdown, flags=re.IGNORECASE
)
if re_match:
# get the version number
-2
View File
@@ -1,5 +1,3 @@
notebooks/official/vizier/gapic-vizier-multi-objective-optimization.ipynb
notebooks/official/pipelines/lightweight_functions_component_io_kfp.ipynb
notebooks/official/ml_metadata/sdk-metric-parameter-tracking-for-locally-trained-models.ipynb
notebooks/official/custom/custom-tabular-bq-managed-dataset.ipynb
.cloud-build/tests/python_version_test.ipynb
@@ -409,7 +409,7 @@
"df = bq_client.list_rows(table).to_dataframe()\n",
"\n",
"# Drop unusable rows\n",
"df = df.replace(to_replace=NA_VALUES, value=np.NaN).dropna()\n",
"df = df.replace(to_replace=NA_VALUES, value=np.nan).dropna()\n",
"\n",
"# Convert categorical columns to numeric\n",
"df[\"island\"], _ = pd.factorize(df[\"island\"])\n",