hockey-blast-common-lib 0.1.58__py3-none-any.whl → 0.1.60__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -203,20 +203,29 @@ def run_aggregate_scorekeeper_stats():
203
203
  session = create_session("boss")
204
204
  human_id_to_debug = None
205
205
 
206
- # Process ALL_ORGS scorekeeper stats only (cross-organizational)
207
- # Scorekeeper quality should be measured across all organizations they work for
208
- if human_id_to_debug is None:
209
- org_progress = create_progress_tracker(3, f"Processing cross-organizational scorekeeper stats")
210
- aggregate_scorekeeper_stats(session, aggregation_type='org', aggregation_id=ALL_ORGS_ID, names_to_filter_out=not_human_names)
211
- org_progress.update(1)
212
- aggregate_scorekeeper_stats(session, aggregation_type='org', aggregation_id=ALL_ORGS_ID, names_to_filter_out=not_human_names, aggregation_window='Weekly')
213
- org_progress.update(2)
214
- aggregate_scorekeeper_stats(session, aggregation_type='org', aggregation_id=ALL_ORGS_ID, names_to_filter_out=not_human_names, aggregation_window='Daily')
215
- org_progress.update(3)
216
- else:
217
- aggregate_scorekeeper_stats(session, aggregation_type='org', aggregation_id=ALL_ORGS_ID, names_to_filter_out=not_human_names)
218
- aggregate_scorekeeper_stats(session, aggregation_type='org', aggregation_id=ALL_ORGS_ID, names_to_filter_out=not_human_names, aggregation_window='Weekly')
219
- aggregate_scorekeeper_stats(session, aggregation_type='org', aggregation_id=ALL_ORGS_ID, names_to_filter_out=not_human_names, aggregation_window='Daily')
206
+ # Get all org_id present in the Organization table (following goalie stats pattern)
207
+ # Individual org calls will be skipped by early exit, only ALL_ORGS_ID will process
208
+ from hockey_blast_common_lib.models import Organization
209
+ org_ids = session.query(Organization.id).all()
210
+ org_ids = [org_id[0] for org_id in org_ids]
211
+
212
+ # Add ALL_ORGS_ID to the list so it gets processed
213
+ org_ids.append(ALL_ORGS_ID)
214
+
215
+ for org_id in org_ids:
216
+ if human_id_to_debug is None:
217
+ org_name = "All Organizations" if org_id == ALL_ORGS_ID else session.query(Organization.organization_name).filter(Organization.id == org_id).scalar() or f"org_id {org_id}"
218
+ org_progress = create_progress_tracker(3, f"Processing scorekeeper stats for {org_name}")
219
+ aggregate_scorekeeper_stats(session, aggregation_type='org', aggregation_id=org_id, names_to_filter_out=not_human_names)
220
+ org_progress.update(1)
221
+ aggregate_scorekeeper_stats(session, aggregation_type='org', aggregation_id=org_id, names_to_filter_out=not_human_names, aggregation_window='Weekly')
222
+ org_progress.update(2)
223
+ aggregate_scorekeeper_stats(session, aggregation_type='org', aggregation_id=org_id, names_to_filter_out=not_human_names, aggregation_window='Daily')
224
+ org_progress.update(3)
225
+ else:
226
+ aggregate_scorekeeper_stats(session, aggregation_type='org', aggregation_id=org_id, names_to_filter_out=not_human_names)
227
+ aggregate_scorekeeper_stats(session, aggregation_type='org', aggregation_id=org_id, names_to_filter_out=not_human_names, aggregation_window='Weekly')
228
+ aggregate_scorekeeper_stats(session, aggregation_type='org', aggregation_id=org_id, names_to_filter_out=not_human_names, aggregation_window='Daily')
220
229
 
221
230
  if __name__ == "__main__":
222
231
  run_aggregate_scorekeeper_stats()
@@ -152,6 +152,19 @@ class HumansInLevels(db.Model):
152
152
  db.UniqueConstraint('levels_monthly_id', 'human_id', name='_levels_monthly_human_uc'),
153
153
  )
154
154
 
155
+ class HumanPrivacyOptOut(db.Model):
156
+ __tablename__ = 'human_privacy_opt_outs'
157
+ id = db.Column(db.Integer, primary_key=True)
158
+ first_name = db.Column(db.String(100), nullable=False)
159
+ middle_name = db.Column(db.String(100), nullable=False, default='')
160
+ last_name = db.Column(db.String(100), nullable=False)
161
+ suffix = db.Column(db.String(100), nullable=False, default='')
162
+ opt_out_date = db.Column(db.DateTime, nullable=False, default=db.func.current_timestamp())
163
+ notes = db.Column(db.Text, nullable=True)
164
+ __table_args__ = (
165
+ db.UniqueConstraint('first_name', 'middle_name', 'last_name', 'suffix', name='_privacy_optout_name_uc'),
166
+ )
167
+
155
168
  class League(db.Model):
156
169
  __tablename__ = 'leagues'
157
170
  id = db.Column(db.Integer, primary_key=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hockey-blast-common-lib
3
- Version: 0.1.58
3
+ Version: 0.1.60
4
4
  Summary: Common library for shared functionality and DB models
5
5
  Author: Pavel Kletskov
6
6
  Author-email: kletskov@gmail.com
@@ -5,14 +5,14 @@ hockey_blast_common_lib/aggregate_h2h_stats.py,sha256=dC5TcJZGkpIQTiq3z40kOX6EjE
5
5
  hockey_blast_common_lib/aggregate_human_stats.py,sha256=ku42TAjUIj49822noM8fEeB8GS4vFeCCNrLupTWmqzg,26043
6
6
  hockey_blast_common_lib/aggregate_referee_stats.py,sha256=mUcTVQH9K4kwmIfgfGsnh_3AqX6Ia3RjfukkYuQas3I,13938
7
7
  hockey_blast_common_lib/aggregate_s2s_stats.py,sha256=urYN0Q06twwLO-XWGlSMVAVOTVR_D2AWdmoGsxIYHXE,6737
8
- hockey_blast_common_lib/aggregate_scorekeeper_stats.py,sha256=dtjJunl5QZb97ypqdrZH9N1MUYZRJvVoswXf0kMeZYA,11794
8
+ hockey_blast_common_lib/aggregate_scorekeeper_stats.py,sha256=Y0SSCBoujXNMs1_f-zn6odbLIrdTTkzOCpUyH40WBVs,12288
9
9
  hockey_blast_common_lib/aggregate_skater_stats.py,sha256=pA_2pDOGcJyEywISg2ySG8gFCuoLWwqw6a3Gm2wHLyo,23302
10
10
  hockey_blast_common_lib/assign_skater_skill.py,sha256=Asq6iRMPsCMDnvuNSd-M3s4Gee4kDocP9Eznwju_9kA,2749
11
11
  hockey_blast_common_lib/db_connection.py,sha256=HvPxDvOj7j5H85RfslGvHVNevfg7mKCd0syJ6NX21mU,1890
12
12
  hockey_blast_common_lib/dump_sample_db.sh,sha256=MY3lnzTXBoWd76-ZlZr9nWsKMEVgyRsUn-LZ2d1JWZs,810
13
13
  hockey_blast_common_lib/h2h_models.py,sha256=0st4xoJO0U6ONfx3BV03BQvHjZE31e_PqZfphAJMoSU,7968
14
- hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz,sha256=0XOu7BnMN-skRFuOmPTTOPjCYci9UdAZ2yoIpkngtPg,4648906
15
- hockey_blast_common_lib/models.py,sha256=JMwQE1QgNkuWuKakxuHIlbEHfk8Z7GAYktCppCWA6LE,18928
14
+ hockey_blast_common_lib/hockey_blast_sample_backup.sql.gz,sha256=e5qPt-WPwRu0-2l5neKpslO_oQtPUU6yiM9rr_In8Q0,4648905
15
+ hockey_blast_common_lib/models.py,sha256=ccM886RcSFDiJ3yj2l9OqRi_PwR1L6WU8AsqzgV3_t0,19598
16
16
  hockey_blast_common_lib/options.py,sha256=rQaLRYYcaxXrpZoXfUpmvsahC23oVGPEOzEpqtthbIQ,1794
17
17
  hockey_blast_common_lib/progress_utils.py,sha256=H_zRFOsb2qQQpGw56wJghZ1nUe_m6zqGeR9hZ33Y1Uo,3229
18
18
  hockey_blast_common_lib/restore_sample_db.sh,sha256=7W3lzRZeu9zXIu1Bvtnaw8EHc1ulHmFM4mMh86oUQJo,2205
@@ -22,7 +22,7 @@ hockey_blast_common_lib/stats_models.py,sha256=64sUq_iWhNXi_b_V_1INuQ1RusKaTASju
22
22
  hockey_blast_common_lib/stats_utils.py,sha256=DXsPO4jw8XsdRUN46TGF_IiBAfz3GCIVBswCGp5ELDk,284
23
23
  hockey_blast_common_lib/utils.py,sha256=PduHp6HoI4sfr5HvJfQAaz7170dy5kTFVdIfWvBR-Jg,5874
24
24
  hockey_blast_common_lib/wsgi.py,sha256=y3NxoJfWjdzX3iP7RGvDEer6zcnPyCanpqSgW1BlXgg,779
25
- hockey_blast_common_lib-0.1.58.dist-info/METADATA,sha256=jCXdoBpO5gfR3UZnUelcFJ8XspPWu3VcvYuCt5QlhQ4,318
26
- hockey_blast_common_lib-0.1.58.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
27
- hockey_blast_common_lib-0.1.58.dist-info/top_level.txt,sha256=wIR4LIkE40npoA2QlOdfCYlgFeGbsHR8Z6r0h46Vtgc,24
28
- hockey_blast_common_lib-0.1.58.dist-info/RECORD,,
25
+ hockey_blast_common_lib-0.1.60.dist-info/METADATA,sha256=6GOkTYr8oNmJWRRPQiAraI4waI5ppLySU5DKBIXP4bw,318
26
+ hockey_blast_common_lib-0.1.60.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
27
+ hockey_blast_common_lib-0.1.60.dist-info/top_level.txt,sha256=wIR4LIkE40npoA2QlOdfCYlgFeGbsHR8Z6r0h46Vtgc,24
28
+ hockey_blast_common_lib-0.1.60.dist-info/RECORD,,