Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,5 @@ climateguard/experiments/claim_extraction/climateguard_claim_extraction

.aws/
germany_s3_bucket/
france_s3_bucket/
.gcloud
2 changes: 1 addition & 1 deletion jobs/label_misinformation/app/country.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def verify_language(self, language: str):
name="prod",
code="None",
language="all",
countries=[BRAZIL_COUNTRY, FRANCE_COUNTRY, GERMANY_COUNTRY],
countries=[BRAZIL_COUNTRY, FRANCE_COUNTRY],
)


Expand Down
25 changes: 23 additions & 2 deletions jobs/label_misinformation/app/sentry_utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
import os
import logging
import sentry_sdk
import tomli
from sentry_sdk.integrations.logging import LoggingIntegration

def get_app_version():
# Open and read the pyproject.toml file
with open('pyproject.toml', 'rb') as toml_file:
pyproject_data = tomli.load(toml_file)

def sentry_init(version="0.0"):
# Access the version from the pyproject.toml file
version = pyproject_data['project']['version']
return version


def sentry_init():
if os.environ.get("SENTRY_DSN", None) != None:
logging.info("Sentry init")
logging_kwargs = {}
if os.getenv("SENTRY_LOGGING") == "true":
logging_kwargs = dict(
enable_logs=True,
integrations=[
# Only send WARNING (and higher) logs to Sentry logs,
# even if the logger is set to a lower level.
LoggingIntegration(sentry_logs_level=logging.INFO),
]
)
sentry_sdk.init(
enable_tracing=False,
traces_sample_rate=0.3,
Expand All @@ -14,7 +35,7 @@ def sentry_init(version="0.0"):
# of sampled transactions.
# We recommend adjusting this value in production,
profiles_sample_rate=0.3,
release=version,
release=get_app_version,
# functions_to_trace=functions_to_trace,
# integrations=[ # TODO : https://docs.sentry.io/platforms/python/integrations/ray/
# RayIntegration(),
Expand Down
1 change: 1 addition & 0 deletions jobs/label_misinformation/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ s3transfer==0.11.2
sentry-sdk==2.22.0
six==1.17.0
sniffio==1.3.1
tomli==2.4.1
tqdm==4.67.1
typing_extensions==4.12.2
tzdata==2025.1
Expand Down
2 changes: 1 addition & 1 deletion jobs/label_misinformation/tests/test_country.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def test_country_collection_presets():
name="prod",
code="None",
language="all",
countries=[BRAZIL_COUNTRY, FRANCE_COUNTRY, GERMANY_COUNTRY],
countries=[BRAZIL_COUNTRY, FRANCE_COUNTRY],
)


Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ dependencies = [
"plotly>=6.5.0",
"protobuf>=6.32.1",
"psutil>=7.1.0",
"psycopg>=3.3.3",
"psycopg2>=2.9.11",
"pydantic>=2.11.9",
"python-dotenv>=1.1.1",
"requests>=2.32.5",
Expand All @@ -34,6 +36,7 @@ dependencies = [
"trl>=0.23.1",
"wandb>=0.22.2",
"wordcloud>=1.9.4",
"tomli>=2.4.1",
]


64 changes: 64 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading