File tree Expand file tree Collapse file tree 4 files changed +32
-1
lines changed Expand file tree Collapse file tree 4 files changed +32
-1
lines changed Original file line number Diff line number Diff line change 1212 - uses : actions/setup-python@v4
1313 with :
1414 python-version : ' 3.10'
15- - run : python -m pip install -r analytics/requirements.txt
15+ - run : python -m pip install -r .github/workflows/ analytics/requirements.txt
1616 - env :
1717 GH_SECRET : ${{ secrets.GITHUB_TOKEN }}
1818 run : python .github/workflows/analytics/cron.py
File renamed without changes.
Original file line number Diff line number Diff line change 1+ google-cloud-bigquery
2+ requests
Original file line number Diff line number Diff line change 1+ from __future__ import annotations
2+
3+ from dataclasses import asdict , dataclass , field
4+
5+
6+ @dataclass
7+ class BaseEvent :
8+ event_type : str = field (init = False )
9+
10+ def to_dict (self ):
11+ return asdict (self )
12+
13+ @dataclass
14+ class CronEvent (BaseEvent ):
15+ num_discord_members_total : int
16+ num_github_stars_total : int
17+
18+ # count for each day
19+ num_python_downloads : int
20+ num_discord_members : int
21+ num_github_stars : int
22+ num_github_repo_views : int
23+ num_documentation_views : int = 0
24+
25+ def __post_init__ (self ):
26+ self .event_type = "cron"
27+
28+ def to_dict (self ):
29+ return asdict (self )
You can’t perform that action at this time.
0 commit comments