Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: deprecate edx sphinx theme #98

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
10 changes: 3 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8, 3.9]
python-version: [3.12]
steps:
- uses: actions/checkout@v2
- name: setup python
Expand All @@ -29,10 +29,6 @@ jobs:
run: pip install tox tox-gh-actions
- name: Run Tests
run: tox
- name: Run Coverage
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true
run_dbt_schema_builder_code_quality:
name: dbt Schema Builder Code Quality
runs-on: ubuntu-20.04
Expand All @@ -41,7 +37,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.12
- name: Install pip, setuptools, and wheel
run: pip install -r requirements/pip.txt
- name: Install dependencies
Expand All @@ -58,7 +54,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.12
- name: Install pip, setuptools, and wheel
run: pip install -r requirements/pip.txt
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: setup python
uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: 3.12

- name: Install pip
run: pip install -r requirements/pip.txt
Expand Down
8 changes: 5 additions & 3 deletions dbt_schema_builder/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class InvalidDatabaseException(Exception):


class GetCatalogTask(CompileTask):

"""
A dbt task to load the information schema to dict in the form of:
{
Expand All @@ -55,6 +56,7 @@ class GetCatalogTask(CompileTask):
}
}
"""

def _get_column_name_filter(self, source_database, banned_column_names):
"""
Create the SQL string to omit banned_column_names from the Snowflake metadata queries.
Expand Down Expand Up @@ -152,7 +154,7 @@ def run(self, source_database, schema, banned_column_names): # pylint: disable=
"""
# Check for any non-word characters that might indicate a SQL injection attack
if re.search("[^a-zA-Z0-9_]", schema):
raise Exception( # pylint: disable=broad-exception-raised
raise Exception(
"Non-word character in schema name '{}'! Possible SQL injection?".format(
schema
)
Expand All @@ -162,7 +164,7 @@ def run(self, source_database, schema, banned_column_names): # pylint: disable=

try:
catalog = self.fetch_full_catalog(adapter, source_database, schema, banned_column_names)
except Exception as e: # pylint: disable=broad-except
except Exception as e:
# TODO: Catch a less-broad exception than Exception.
if "Information schema query returned too much data" not in str(e):
raise
Expand Down Expand Up @@ -605,7 +607,7 @@ def get_project_dirs(self):

for project_path in [source_project_path, destination_project_path]:
if not os.path.exists(os.path.join(project_path, "dbt_project.yml")):
raise Exception( # pylint: disable=broad-exception-raised
raise Exception(
"fatal: {} is not a dbt project. Does not exist or is missing a "
"dbt_project.yml file.".format(project_path)
)
Expand Down
43 changes: 35 additions & 8 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
import re
import sys
from subprocess import check_call
from datetime import datetime

import edx_theme
import sphinx_book_theme


def get_version(*file_paths):
Expand Down Expand Up @@ -61,7 +62,6 @@ def get_version(*file_paths):
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'edx_theme',
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
Expand Down Expand Up @@ -92,8 +92,8 @@ def get_version(*file_paths):

# General information about the project.
project = 'dbt-schema-builder'
copyright = edx_theme.COPYRIGHT # pylint: disable=redefined-builtin
author = edx_theme.AUTHOR
copyright = f'{datetime.now().year}, edX LLC.' # pylint: disable=redefined-builtin
author = "edX LLC."
project_title = 'dbt-schema-builder'
documentation_title = "{project_title}".format(project_title=project_title)

Expand Down Expand Up @@ -164,16 +164,43 @@ def get_version(*file_paths):
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.

html_theme = 'edx_theme'
html_theme = 'sphinx_book_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}

# Add any paths that contain custom themes here, relative to this directory.
html_theme_path = [edx_theme.get_html_theme_path()]
html_theme_options = {
"repository_url": "https://github.com/edx/dbt-schema-builder",
"repository_branch": "main",
"path_to_docs": "docs/",
"use_repository_button": True,
"use_issues_button": True,
"use_edit_page_button": True,
# Please don't change unless you know what you're doing.
"extra_footer": """
<a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">
<img
alt="Creative Commons License"
style="border-width:0"
src="https://i.creativecommons.org/l/by-sa/4.0/80x15.png"/>
</a>
<br>
These works by
<a
xmlns:cc="https://creativecommons.org/ns#"
href="https://edx.org"
property="cc:attributionName"
rel="cc:attributionURL"
>edX LLC</a>
are licensed under a
<a
rel="license"
href="https://creativecommons.org/licenses/by-sa/4.0/"
>Creative Commons Attribution-ShareAlike 4.0 International License</a>.
"""
}

# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
Expand Down
Loading
Loading