From 2cbee5fd22ce4b5ccae544afc534771421055c53 Mon Sep 17 00:00:00 2001 From: yaroslav Date: Tue, 3 Feb 2026 16:21:40 +0300 Subject: [PATCH 1/5] fixed dwh-pipelines #229 issue --- profcomff_definitions/STG/github.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/profcomff_definitions/STG/github.py b/profcomff_definitions/STG/github.py index dc0b05ea..b90554b6 100644 --- a/profcomff_definitions/STG/github.py +++ b/profcomff_definitions/STG/github.py @@ -249,6 +249,8 @@ class ProfcomffTeam(Base): repositories_url: Mapped[str | None] permission: Mapped[str | None] parent: Mapped[str | None] + type: Mapped[str | None] + organization_id: Mapped[int | None] class ProfcomffTeamMember(Base): @@ -271,6 +273,7 @@ class ProfcomffTeamMember(Base): received_events_url: Mapped[str | None] type: Mapped[str | None] site_admin: Mapped[bool | None] + user_view_type: Mapped[str | None] class ProfcomffTeamRepo(Base): @@ -379,6 +382,7 @@ class ProfcomffTeamRepo(Base): permissions_pull: Mapped[str | None] role_name: Mapped[str | None] license: Mapped[str | None] + owner_user_view_type: Mapped[str | None] class ProfcomffCommit(Base): From 4fd33d7aa7d29f8d8da9404851624ea499e4fb86 Mon Sep 17 00:00:00 2001 From: yaroslav Date: Tue, 3 Feb 2026 18:54:46 +0300 Subject: [PATCH 2/5] alembic_added --- migrations/env.py | 8 +++-- ...03_1853_1a5ed9901423_user_view_type_fix.py | 36 +++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 migrations/versions/20260203_1853_1a5ed9901423_user_view_type_fix.py diff --git a/migrations/env.py b/migrations/env.py index b21c1739..0f9f11cc 100644 --- a/migrations/env.py +++ b/migrations/env.py @@ -21,7 +21,9 @@ def include_object(object, name, type_, reflected, compare_to): Should you include this table or not? """ - if type_ == "table" and (name in IGNORE_TABLES or object.info.get("skip_autogenerate", False)): + if type_ == "table" and ( + name in IGNORE_TABLES or object.info.get("skip_autogenerate", False) + ): return False elif type_ == "column" and object.info.get("skip_autogenerate", False): @@ -111,7 +113,9 @@ def run_migrations_online(): """ configuration = config.get_section(config.config_ini_section) - configuration["sqlalchemy.url"] = os.getenv("DB_DSN", "postgresql://postgres:12345@postgres:5432/postgres") + configuration["sqlalchemy.url"] = os.getenv( + "DB_DSN", "postgresql://postgres:12345@localhost:5432/postgres" + ) connectable = engine_from_config( configuration, prefix="sqlalchemy.", diff --git a/migrations/versions/20260203_1853_1a5ed9901423_user_view_type_fix.py b/migrations/versions/20260203_1853_1a5ed9901423_user_view_type_fix.py new file mode 100644 index 00000000..3edb3b54 --- /dev/null +++ b/migrations/versions/20260203_1853_1a5ed9901423_user_view_type_fix.py @@ -0,0 +1,36 @@ +"""user_view_type_fix + +Revision ID: 1a5ed9901423 +Revises: ac67f7273994 +Create Date: 2026-02-03 18:53:36.874014 + +""" +import os + +import sqlalchemy as sa +from alembic import op + + +# revision identifiers, used by Alembic. +revision = '1a5ed9901423' +down_revision = 'ac67f7273994' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('profcomff_team', sa.Column('type', sa.String(), nullable=True), schema='STG_GITHUB') + op.add_column('profcomff_team', sa.Column('organization_id', sa.Integer(), nullable=True), schema='STG_GITHUB') + op.add_column('profcomff_team_member', sa.Column('user_view_type', sa.String(), nullable=True), schema='STG_GITHUB') + op.add_column('profcomff_team_repo', sa.Column('owner_user_view_type', sa.String(), nullable=True), schema='STG_GITHUB') + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('profcomff_team_repo', 'owner_user_view_type', schema='STG_GITHUB') + op.drop_column('profcomff_team_member', 'user_view_type', schema='STG_GITHUB') + op.drop_column('profcomff_team', 'organization_id', schema='STG_GITHUB') + op.drop_column('profcomff_team', 'type', schema='STG_GITHUB') + # ### end Alembic commands ### From f33de716b11d37def2777128f301998e2552bbbb Mon Sep 17 00:00:00 2001 From: yaroslav Date: Tue, 3 Feb 2026 19:57:39 +0300 Subject: [PATCH 3/5] formating --- migrations/env.py | 8 ++------ .../20260203_1853_1a5ed9901423_user_view_type_fix.py | 5 ++++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/migrations/env.py b/migrations/env.py index 0f9f11cc..c4d83c8f 100644 --- a/migrations/env.py +++ b/migrations/env.py @@ -21,9 +21,7 @@ def include_object(object, name, type_, reflected, compare_to): Should you include this table or not? """ - if type_ == "table" and ( - name in IGNORE_TABLES or object.info.get("skip_autogenerate", False) - ): + if type_ == "table" and (name in IGNORE_TABLES or object.info.get("skip_autogenerate", False)): return False elif type_ == "column" and object.info.get("skip_autogenerate", False): @@ -113,9 +111,7 @@ def run_migrations_online(): """ configuration = config.get_section(config.config_ini_section) - configuration["sqlalchemy.url"] = os.getenv( - "DB_DSN", "postgresql://postgres:12345@localhost:5432/postgres" - ) + configuration["sqlalchemy.url"] = os.getenv("DB_DSN", "postgresql://postgres:12345@localhost:5432/postgres") connectable = engine_from_config( configuration, prefix="sqlalchemy.", diff --git a/migrations/versions/20260203_1853_1a5ed9901423_user_view_type_fix.py b/migrations/versions/20260203_1853_1a5ed9901423_user_view_type_fix.py index 3edb3b54..f0ec92d6 100644 --- a/migrations/versions/20260203_1853_1a5ed9901423_user_view_type_fix.py +++ b/migrations/versions/20260203_1853_1a5ed9901423_user_view_type_fix.py @@ -5,6 +5,7 @@ Create Date: 2026-02-03 18:53:36.874014 """ + import os import sqlalchemy as sa @@ -23,7 +24,9 @@ def upgrade(): op.add_column('profcomff_team', sa.Column('type', sa.String(), nullable=True), schema='STG_GITHUB') op.add_column('profcomff_team', sa.Column('organization_id', sa.Integer(), nullable=True), schema='STG_GITHUB') op.add_column('profcomff_team_member', sa.Column('user_view_type', sa.String(), nullable=True), schema='STG_GITHUB') - op.add_column('profcomff_team_repo', sa.Column('owner_user_view_type', sa.String(), nullable=True), schema='STG_GITHUB') + op.add_column( + 'profcomff_team_repo', sa.Column('owner_user_view_type', sa.String(), nullable=True), schema='STG_GITHUB' + ) # ### end Alembic commands ### From b97c0be35de32e1f267f92be65ffc061e9451307 Mon Sep 17 00:00:00 2001 From: yaroslav Date: Thu, 5 Feb 2026 13:27:08 +0300 Subject: [PATCH 4/5] black 23.11.0 fix --- .github/workflows/checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index da997083..d431073c 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -67,7 +67,7 @@ jobs: - uses: isort/isort-action@master with: requirementsFiles: "requirements.txt requirements.dev.txt" - - uses: psf/black@stable + - uses: psf/black@23.11.0 - name: Comment if linting failed if: failure() id: comment From 5a75595cf2d7d8e5c98c04e5718ae205485ca6fe Mon Sep 17 00:00:00 2001 From: yaroslav Date: Thu, 5 Feb 2026 14:31:51 +0300 Subject: [PATCH 5/5] fixed local host and added black version --- migrations/env.py | 2 +- requirements.dev.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/migrations/env.py b/migrations/env.py index c4d83c8f..6f0ad12c 100644 --- a/migrations/env.py +++ b/migrations/env.py @@ -111,7 +111,7 @@ def run_migrations_online(): """ configuration = config.get_section(config.config_ini_section) - configuration["sqlalchemy.url"] = os.getenv("DB_DSN", "postgresql://postgres:12345@localhost:5432/postgres") + configuration["sqlalchemy.url"] = os.getenv("DB_DSN", "postgresql://postgres:12345@postgres::5432/postgres") connectable = engine_from_config( configuration, prefix="sqlalchemy.", diff --git a/requirements.dev.txt b/requirements.dev.txt index faa951f3..6976fa6d 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -1,6 +1,6 @@ definitions_lib autoflake -black +black==23.11.0 setuptools flake8 httpx