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

Add active flag to sites #166 #176

Conversation

PrabhasKalyan
Copy link
Contributor

This pull request adds an active flag to the sites table, allowing sites to be toggled on or off based on their active status. The change has been tested for functionality and includes relevant tests to ensure compliance with guidelines.

it would be great to have an active flag on the sites table

we can turn this on and off, dependent if the site is active
Upgraded Pandas to 2.3.0
Added Active flag to sites
Added filter on api read

include_in_url = None
exclude_in_url = None

Copy link
Contributor

Choose a reason for hiding this comment

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

could you make these inputs toe the function, and they default to None?

@@ -138,9 +149,17 @@ def get_api_requests_for_one_user(
:param start_datetime: only get api requests after start datetime
:param end_datetime: only get api requests before end datetime
"""
include_in_url = None
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment as above?

@peterdudfield
Copy link
Contributor

hi @PrabhasKalyan thanks so much for doing this

Ive left a small comment on this,

Would you also be able to

  1. add a test?
  2. add a alembic migration?

Adding include_in_url = None
    exclude_in_url = None
to function
Adding alembic migrations
adding tests
put tests/test_write.py in test/write
def get_all_last_api_request(
session: Session,
include_in_url=None,
exclude_in_url=None,
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 do exclude_in_url: Optional[str] = None, you my need to add a import, from typing import Optional

Could you add a sentence in hte function description too?

@@ -48,5 +59,7 @@ def test_get_api_requests_for_one_user_end_datetime(db_session):
session=db_session,
email=user.email,
end_datetime=dt.datetime.now(tz=dt.timezone.utc) - dt.timedelta(hours=1),
include_in_url=None,
exclude_in_url=None,
)
assert len(requests_sql) == 0
Copy link
Contributor

@peterdudfield peterdudfield Nov 25, 2024

Choose a reason for hiding this comment

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

perhaps leave this test how they are, and add a new test, where we can clear see that the include_in_url is working, i.e. set it to a value. Simialr for exclude_in_url

@PrabhasKalyan PrabhasKalyan deleted the Add-active-flag-to-sites-#166 branch November 25, 2024 11:43
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.

2 participants