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

Tickets/obsproc 110 #104

Merged
merged 6 commits into from
Dec 21, 2024
Merged

Tickets/obsproc 110 #104

merged 6 commits into from
Dec 21, 2024

Conversation

monodera
Copy link
Contributor

Add partner information (subaru, keck, gemini, uh, etc.) to proposal table.

- Added: `partner_id` column in the `proposal` column
- Added: `partner.partner_id` and `proposal.partner_id` are related.
- Added: `partner` table
- Added: `example/data/partner.csv`
- Added: alembic update file
- Removed: "keck", "gemini", and "uh" from `proposal_category` values
- CLI code is modified to accommodate the possible path change. Older versions
  are not compatible
docs/schema/partner.md Dismissed Show dismissed Hide dismissed

Here are the columns in the `partner` table:

| Column Name | Type | Description | Required[^1] | Default |

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when references to undefined definitions are found. Note documentation

[no-undefined-references] Found reference to undefined definition
| created_at | datetime | The date and time in UTC when the record was created. | | |
| updated_at | datetime | The date and time in UTC when the record was last updated. | | |

[^1]: Required when inserted by using the [CLI tool](../reference/cli.md) or equivalent functions.

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when references to undefined definitions are found. Note documentation

[no-undefined-references] Found reference to undefined definition
| created_at | datetime | The date and time in UTC when the record was created. | | |
| updated_at | datetime | The date and time in UTC when the record was last updated. | | |

[^1]: Required when inserted by using the [CLI tool](../reference/cli.md) or equivalent functions.

Check notice

Code scanning / Remark-lint (reported by Codacy)

Warn when shortcut reference links are used. Note documentation

[no-shortcut-reference-link] Use the trailing [] on reference links
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pylint (reported by Codacy) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.


"""
from alembic import op
import sqlalchemy as sa

Check warning

Code scanning / Prospector (reported by Codacy)

Unable to import 'sqlalchemy' (import-error) Warning

Unable to import 'sqlalchemy' (import-error)
sa.Column('partner_id', sa.Integer(), autoincrement=False, nullable=False, comment='Unique identifier of the partner'),
sa.Column('partner_name', sa.String(), nullable=False, comment='Name of the partner (e.g., subaru, gemini, keck, and uh)'),
sa.Column('partner_description', sa.String(), nullable=True, comment='Description of the partner'),
sa.Column('created_at', sa.DateTime(), server_default=sa.text("TIMEZONE('utc', CURRENT_TIMESTAMP)"), nullable=True, comment='The date and time in UTC when the record was created'),

Check warning

Code scanning / Prospector (reported by Codacy)

line too long (184 > 159 characters) (E501) Warning

line too long (184 > 159 characters) (E501)
@@ -36,6 +36,7 @@
from .filter_name import filter_name # noqa E402
from .pfs_arm import pfs_arm # noqa E402
from .proposal_category import proposal_category # noqa E402
from .partner import partner # noqa E402

Check warning

Code scanning / Prospector (reported by Codacy)

Import "from .partner import partner" should be placed at the top of the module (wrong-import-position) Warning

Import "from .partner import partner" should be placed at the top of the module (wrong-import-position)
src/targetdb/models/__init__.py Fixed Show fixed Hide fixed
@@ -0,0 +1,44 @@
#!/usr/bin/env python

from sqlalchemy import (

Check warning

Code scanning / Prospector (reported by Codacy)

Unable to import 'sqlalchemy' (import-error) Warning

Unable to import 'sqlalchemy' (import-error)
Integer,
String,
)
from sqlalchemy.orm import relationship

Check warning

Code scanning / Prospector (reported by Codacy)

Unable to import 'sqlalchemy.orm' (import-error) Warning

Unable to import 'sqlalchemy.orm' (import-error)
@@ -0,0 +1,41 @@
"""add partner column in the proposal table and partner table

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Module name "20241220-145409_0b72e62efd44_add_partner_column_in_the_proposal_" doesn't conform to snake_case naming style Warning

Module name "20241220-145409_0b72e62efd44_add_partner_column_in_the_proposal_" doesn't conform to snake_case naming style

"""
from alembic import op
import sqlalchemy as sa

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

third party import "import sqlalchemy as sa" should be placed before "from alembic import op" Warning

third party import "import sqlalchemy as sa" should be placed before "from alembic import op"


# revision identifiers, used by Alembic.
revision = '0b72e62efd44'

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Constant name "revision" doesn't conform to UPPER_CASE naming style Warning

Constant name "revision" doesn't conform to UPPER_CASE naming style

# revision identifiers, used by Alembic.
revision = '0b72e62efd44'
down_revision = 'b68482e38606'

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Constant name "down_revision" doesn't conform to UPPER_CASE naming style Warning

Constant name "down_revision" doesn't conform to UPPER_CASE naming style
# revision identifiers, used by Alembic.
revision = '0b72e62efd44'
down_revision = 'b68482e38606'
branch_labels = None

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Constant name "branch_labels" doesn't conform to UPPER_CASE naming style Warning

Constant name "branch_labels" doesn't conform to UPPER_CASE naming style
@@ -0,0 +1,44 @@
#!/usr/bin/env python

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Missing module docstring Warning

Missing module docstring
from . import Base, comment_created_at, comment_updated_at, utcnow


class partner(Base):

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Class name "partner" doesn't conform to PascalCase naming style Warning

Class name "partner" doesn't conform to PascalCase naming style
from . import Base, comment_created_at, comment_updated_at, utcnow


class partner(Base):

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Too few public methods (0/2) Warning

Too few public methods (0/2)
from . import Base, comment_created_at, comment_updated_at, utcnow


class partner(Base):

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Missing class docstring Warning

Missing class docstring
@@ -307,7 +307,8 @@
outfile = os.path.join(output_dir, f"{sc_outprefix}-{time_string}.pdf")

comm = [
f"{os.path.join(config['schemacrawler']['SCHEMACRAWLERDIR'],'_schemacrawler/bin/schemacrawler.sh')}",
f"{os.path.join(config['schemacrawler']['SCHEMACRAWLERDIR'],'bin/schemacrawler.sh')}",
# f"{os.path.join(config['schemacrawler']['SCHEMACRAWLERDIR'],'_schemacrawler/bin/schemacrawler.sh')}",

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Line too long (115/100) Warning

Line too long (115/100)
@monodera monodera merged commit 5829a05 into main Dec 21, 2024
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant