Skip to content

Commit

Permalink
lint: define custom exception class
Browse files Browse the repository at this point in the history
  • Loading branch information
yolile committed Feb 10, 2024
1 parent eaa6cde commit ea4a0be
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 deletions.
5 changes: 4 additions & 1 deletion component_charts.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,14 @@
"source": [
"import altair as alt\n",
"\n",
"class MissingColumns(Exception):\n",
" def __init__(self, columns):\n",
" super().__init__(f\"The source data is missing one or more of these columns: {columns}\")\n",
"\n",
"def check_columns(columns, data):\n",
" # check if input contains the right columns\n",
" if not columns.issubset(data.columns):\n",
" raise ValueError(f\"Input data must contain the columns {columns}\")\n",
" raise MissingColumns(columns)\n",
"\n",
"\n",
"def plot_release_count(release_counts):\n",
Expand Down
5 changes: 4 additions & 1 deletion template_data_quality_feedback.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,14 @@
"source": [
"import altair as alt\n",
"\n",
"class MissingColumns(Exception):\n",
" def __init__(self, columns):\n",
" super().__init__(f\"The source data is missing one or more of these columns: {columns}\")\n",
"\n",
"def check_columns(columns, data):\n",
" # check if input contains the right columns\n",
" if not columns.issubset(data.columns):\n",
" raise ValueError(f\"Input data must contain the columns {columns}\")\n",
" raise MissingColumns(columns)\n",
"\n",
"\n",
"def plot_release_count(release_counts):\n",
Expand Down
5 changes: 4 additions & 1 deletion template_publisher_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,14 @@
"source": [
"import altair as alt\n",
"\n",
"class MissingColumns(Exception):\n",
" def __init__(self, columns):\n",
" super().__init__(f\"The source data is missing one or more of these columns: {columns}\")\n",
"\n",
"def check_columns(columns, data):\n",
" # check if input contains the right columns\n",
" if not columns.issubset(data.columns):\n",
" raise ValueError(f\"Input data must contain the columns {columns}\")\n",
" raise MissingColumns(columns)\n",
"\n",
"\n",
"def plot_release_count(release_counts):\n",
Expand Down
5 changes: 4 additions & 1 deletion template_structure_and_format_feedback.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,14 @@
"source": [
"import altair as alt\n",
"\n",
"class MissingColumns(Exception):\n",
" def __init__(self, columns):\n",
" super().__init__(f\"The source data is missing one or more of these columns: {columns}\")\n",
"\n",
"def check_columns(columns, data):\n",
" # check if input contains the right columns\n",
" if not columns.issubset(data.columns):\n",
" raise ValueError(f\"Input data must contain the columns {columns}\")\n",
" raise MissingColumns(columns)\n",
"\n",
"\n",
"def plot_release_count(release_counts):\n",
Expand Down
5 changes: 4 additions & 1 deletion template_usability_checks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,14 @@
"source": [
"import altair as alt\n",
"\n",
"class MissingColumns(Exception):\n",
" def __init__(self, columns):\n",
" super().__init__(f\"The source data is missing one or more of these columns: {columns}\")\n",
"\n",
"def check_columns(columns, data):\n",
" # check if input contains the right columns\n",
" if not columns.issubset(data.columns):\n",
" raise ValueError(f\"Input data must contain the columns {columns}\")\n",
" raise MissingColumns(columns)\n",
"\n",
"\n",
"def plot_release_count(release_counts):\n",
Expand Down
5 changes: 4 additions & 1 deletion template_usability_checks_fieldlist.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,14 @@
"source": [
"import altair as alt\n",
"\n",
"class MissingColumns(Exception):\n",
" def __init__(self, columns):\n",
" super().__init__(f\"The source data is missing one or more of these columns: {columns}\")\n",
"\n",
"def check_columns(columns, data):\n",
" # check if input contains the right columns\n",
" if not columns.issubset(data.columns):\n",
" raise ValueError(f\"Input data must contain the columns {columns}\")\n",
" raise MissingColumns(columns)\n",
"\n",
"\n",
"def plot_release_count(release_counts):\n",
Expand Down
5 changes: 4 additions & 1 deletion template_usability_checks_registry.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,14 @@
"source": [
"import altair as alt\n",
"\n",
"class MissingColumns(Exception):\n",
" def __init__(self, columns):\n",
" super().__init__(f\"The source data is missing one or more of these columns: {columns}\")\n",
"\n",
"def check_columns(columns, data):\n",
" # check if input contains the right columns\n",
" if not columns.issubset(data.columns):\n",
" raise ValueError(f\"Input data must contain the columns {columns}\")\n",
" raise MissingColumns(columns)\n",
"\n",
"\n",
"def plot_release_count(release_counts):\n",
Expand Down

0 comments on commit ea4a0be

Please sign in to comment.