Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ repos:
- id: nbqa-isort
args: [--profile=black, -l80]
- repo: https://github.com/PyCQA/isort
rev: 7.0.0
rev: 8.0.1
hooks:
- id: isort
args: ["--profile", "black", "-l80"]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.12.0
rev: 26.3.1
hooks:
- id: black
args: [-l 80]
Expand All @@ -50,7 +50,7 @@ repos:
- id: pyupgrade
args: [--py36-plus]
- repo: https://github.com/pycqa/pylint
rev: v4.0.4
rev: v4.0.5
hooks:
- id: pylint
args: ["--disable", "unexpected-keyword-arg,no-value-for-parameter,too-many-function-args"]
24 changes: 6 additions & 18 deletions notebooks/end-to-end-structured/labs/4a_sample_babyweight.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,7 @@
" ) AS hash_values\n",
"FROM\n",
" ({CTE_hash_cols_fixed})\n",
"\"\"\".format(\n",
" CTE_hash_cols_fixed=hash_cols_fixed_query\n",
")\n",
"\"\"\".format(CTE_hash_cols_fixed=hash_cols_fixed_query)\n",
"\n",
"display_dataframe_head_from_query(data_query)"
]
Expand All @@ -253,9 +251,7 @@
" ({CTE_data})\n",
"GROUP BY\n",
" hash_values\n",
"\"\"\".format(\n",
" CTE_data=data_query\n",
")\n",
"\"\"\".format(CTE_data=data_query)\n",
"\n",
"display_dataframe_head_from_query(first_bucketing_query)"
]
Expand Down Expand Up @@ -314,9 +310,7 @@
" ({CTE_second_bucketing})) AS percent_records\n",
"FROM\n",
" ({CTE_second_bucketing})\n",
"\"\"\".format(\n",
" CTE_second_bucketing=second_bucketing_query\n",
")\n",
"\"\"\".format(CTE_second_bucketing=second_bucketing_query)\n",
"\n",
"display_dataframe_head_from_query(percentages_query)"
]
Expand Down Expand Up @@ -344,9 +338,7 @@
"WHERE\n",
" bucket_index >= 0\n",
" AND bucket_index < {train_buckets}\n",
"\"\"\".format(\n",
" CTE_percentages=percentages_query, train_buckets=train_buckets\n",
")\n",
"\"\"\".format(CTE_percentages=percentages_query, train_buckets=train_buckets)\n",
"\n",
"display_dataframe_head_from_query(train_query)"
]
Expand Down Expand Up @@ -447,9 +439,7 @@
" *\n",
"FROM\n",
" ({CTE_test})\n",
"\"\"\".format(\n",
" CTE_train=train_query, CTE_eval=eval_query, CTE_test=test_query\n",
")\n",
"\"\"\".format(CTE_train=train_query, CTE_eval=eval_query, CTE_test=test_query)\n",
"\n",
"display_dataframe_head_from_query(union_query)"
]
Expand Down Expand Up @@ -481,9 +471,7 @@
" dataset_name\n",
"ORDER BY\n",
" dataset_id\n",
"\"\"\".format(\n",
" CTE_union=union_query\n",
")\n",
"\"\"\".format(CTE_union=union_query)\n",
"\n",
"display_dataframe_head_from_query(split_query)"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,7 @@
" year > 2000\n",
" GROUP BY\n",
" {column_name}\n",
" \"\"\".format(\n",
" column_name=column_name\n",
" )\n",
" \"\"\".format(column_name=column_name)\n",
"\n",
" return bq.query(sql).to_dataframe()"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,7 @@
" ) AS hash_values\n",
"FROM\n",
" ({CTE_hash_cols_fixed})\n",
"\"\"\".format(\n",
" CTE_hash_cols_fixed=hash_cols_fixed_query\n",
")\n",
"\"\"\".format(CTE_hash_cols_fixed=hash_cols_fixed_query)\n",
"\n",
"display_dataframe_head_from_query(data_query)"
]
Expand All @@ -249,9 +247,7 @@
" ({CTE_data})\n",
"GROUP BY\n",
" hash_values\n",
"\"\"\".format(\n",
" CTE_data=data_query\n",
")\n",
"\"\"\".format(CTE_data=data_query)\n",
"\n",
"display_dataframe_head_from_query(first_bucketing_query)"
]
Expand Down Expand Up @@ -310,9 +306,7 @@
" ({CTE_second_bucketing})) AS percent_records\n",
"FROM\n",
" ({CTE_second_bucketing})\n",
"\"\"\".format(\n",
" CTE_second_bucketing=second_bucketing_query\n",
")\n",
"\"\"\".format(CTE_second_bucketing=second_bucketing_query)\n",
"\n",
"display_dataframe_head_from_query(percentages_query)"
]
Expand Down Expand Up @@ -340,9 +334,7 @@
"WHERE\n",
" bucket_index >= 0\n",
" AND bucket_index < {train_buckets}\n",
"\"\"\".format(\n",
" CTE_percentages=percentages_query, train_buckets=train_buckets\n",
")\n",
"\"\"\".format(CTE_percentages=percentages_query, train_buckets=train_buckets)\n",
"\n",
"display_dataframe_head_from_query(train_query)"
]
Expand Down Expand Up @@ -443,9 +435,7 @@
" *\n",
"FROM\n",
" ({CTE_test})\n",
"\"\"\".format(\n",
" CTE_train=train_query, CTE_eval=eval_query, CTE_test=test_query\n",
")\n",
"\"\"\".format(CTE_train=train_query, CTE_eval=eval_query, CTE_test=test_query)\n",
"\n",
"display_dataframe_head_from_query(union_query)"
]
Expand Down Expand Up @@ -477,9 +467,7 @@
" dataset_name\n",
"ORDER BY\n",
" dataset_id\n",
"\"\"\".format(\n",
" CTE_union=union_query\n",
")\n",
"\"\"\".format(CTE_union=union_query)\n",
"\n",
"display_dataframe_head_from_query(split_query)"
]
Expand Down
2 changes: 1 addition & 1 deletion notebooks/image_models/labs/1_mnist_linear_dnn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
"def create_shape_test(training):\n",
" dataset = load_dataset(training=training)\n",
" data_iter = dataset.__iter__()\n",
" (images, labels) = data_iter.get_next()\n",
" images, labels = data_iter.get_next()\n",
" expected_image_shape = (BATCH_SIZE, HEIGHT, WIDTH)\n",
" expected_label_ndim = 2\n",
" assert images.shape == expected_image_shape\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/image_models/solutions/1_mnist_linear_dnn.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
"def create_shape_test(training):\n",
" dataset = load_dataset(training=training)\n",
" data_iter = dataset.__iter__()\n",
" (images, labels) = data_iter.get_next()\n",
" images, labels = data_iter.get_next()\n",
" expected_image_shape = (BATCH_SIZE, HEIGHT, WIDTH)\n",
" expected_label_ndim = 2\n",
" assert images.shape == expected_image_shape\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Run a compiled Kubeflow pipeline on Vertex AI."""

import fire
from google.cloud import aiplatform

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Kubeflow Covertype Pipeline."""

import os

from kfp import dsl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Lightweight component training function."""

from kfp.dsl import component


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Lightweight component tuning function."""

from typing import NamedTuple

from kfp.dsl import component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Covertype Classifier trainer script."""

import os
import pickle
import subprocess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Run a compiled Kubeflow pipeline on Vertex AI."""

import fire
from google.cloud import aiplatform

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Kubeflow Covertype Pipeline."""

import os

from kfp import dsl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Lightweight component training function."""

from kfp.dsl import component


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Lightweight component tuning function."""

from typing import NamedTuple

from kfp.dsl import component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Covertype Classifier trainer script."""

import os
import pickle
import subprocess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# permissions and limitations under the License.

"""Kubeflow Covertype Pipeline."""

import os

from google.cloud.aiplatform import hyperparameter_tuning as hpt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Lightweight component tuning function."""

from typing import Dict, List, NamedTuple

from kfp.dsl import component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Covertype Classifier trainer script."""

import os
import pickle
import subprocess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Kubeflow Covertype Pipeline."""

# pylint: disable=unused-import,unused-argument,unused-variable
import os

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Lightweight component tuning function."""

from typing import Dict, List, NamedTuple

from kfp.dsl import component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Lightweight component training function."""

from kfp.dsl import component


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Lightweight component tuning function."""

from typing import NamedTuple

from kfp.dsl import component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Covertype Classifier trainer script."""

import os
import pickle
import subprocess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Kubeflow Covertype Pipeline."""

import os

from kfp import dsl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Kubeflow Covertype Pipeline."""

import os

from google.cloud.aiplatform import hyperparameter_tuning as hpt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Lightweight component tuning function."""

from typing import Dict, List, NamedTuple

from kfp.dsl import component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Lightweight component training function."""

from kfp.dsl import component


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
"""Lightweight component tuning function."""

from typing import NamedTuple

from kfp.dsl import component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
"""Covertype Classifier trainer script."""

import os
import pickle
import subprocess
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@
"WHERE\n",
" REGEXP_CONTAINS(REGEXP_EXTRACT(url, '{0}'), '.com$')\n",
" AND LENGTH(title) > 10\n",
"\"\"\".format(\n",
" regex\n",
")\n",
"\"\"\".format(regex)\n",
"\n",
"\n",
"query = \"\"\"\n",
Expand All @@ -165,9 +163,7 @@
"FROM\n",
" ({sub_query})\n",
"WHERE (source = 'github' OR source = 'nytimes' OR source = 'techcrunch')\n",
"\"\"\".format(\n",
" sub_query=sub_query\n",
")\n",
"\"\"\".format(sub_query=sub_query)\n",
"\n",
"print(query)"
]
Expand Down
Loading
Loading