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

v0.5.0 #90

Merged
merged 13 commits into from
Jul 8, 2023
Merged

v0.5.0 #90

merged 13 commits into from
Jul 8, 2023

Conversation

khoroshevskyi
Copy link
Member

@khoroshevskyi khoroshevskyi commented Jul 6, 2023

Retructured all db! Now we have 3 tables: projects, samples, and subsamples
One step closer to:

@khoroshevskyi khoroshevskyi requested a review from ayobi July 6, 2023 20:47
requirements/requirements-all.txt Show resolved Hide resolved
@nsheff
Copy link
Contributor

nsheff commented Jul 7, 2023

I notice there's not samples module. are you planning to add that later?

@nsheff
Copy link
Contributor

nsheff commented Jul 7, 2023

usually there's a newline between description and params in docstrings, but I see several docstrings that are missing that now. can you update your docstrings?

eg:

Get project by providing search string.
:param namespace: namespace where to search for a project

@nsheff
Copy link
Contributor

nsheff commented Jul 7, 2023

is this docstring correct?

Class that represents Projects in Database.

If so I recommend this be named PEPDatabaseProjects instead of PEPDatabaseProject. But I think that is wrong and it only can represent a single Project (not Projects).

except KeyError:
return ""


class Projects(Base):
__tablename__ = "projects"

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add docstrings to all these classes? I cannot infer what they are used for.


class Samples(Base):
__tablename__ = "samples"

Copy link
Contributor

Choose a reason for hiding this comment

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

Missing docstring

if found_prj.samples_mapping:
for sample in found_prj.samples_mapping:
_LOGGER.debug(f"deleting samples: {str(sample)}")
session.delete(sample)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to delete more than 1 at time instead of looping like this?

eg, DELETE WHERE ...

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the easiest way how to do it using sqlalchemy that I found. Not sure if it's possible using declarative object

if found_prj.subsamples_mapping:
for subsample in found_prj.subsamples_mapping:
_LOGGER.debug(f"deleting subsamples: {str(subsample)}")
session.delete(subsample)
Copy link
Contributor

Choose a reason for hiding this comment

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

same here; this seems like an inefficient way to do this.

@khoroshevskyi
Copy link
Member Author

I think I've addressed all comments

@khoroshevskyi khoroshevskyi changed the base branch from dev to master July 8, 2023 17:02
@khoroshevskyi khoroshevskyi changed the title New table structure v0.5.0 Jul 8, 2023
@khoroshevskyi khoroshevskyi merged commit 8541366 into master Jul 8, 2023
@khoroshevskyi khoroshevskyi deleted the new_table_structure branch August 3, 2023 02:03
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.

3 participants