Skip to content

Commit 572022e

Browse files
h-joometerstick-copybara
authored andcommitted
No public description
PiperOrigin-RevId: 956272640
1 parent 9d1321a commit 572022e

5 files changed

Lines changed: 26 additions & 26 deletions

File tree

‎confidence_interval_display.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from IPython.display import HTML
2222
import pandas as pd
2323
import six
24-
from six.moves import range
24+
from six.moves import range # pyrefly: ignore[missing-source-for-stubs]
2525

2626

2727
CSS = '''

‎metrics.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ def get_extra_idx(self, return_superset=False):
10121012
"""
10131013
extra_idx = self.extra_index[:] # pyrefly: ignore[bad-index]
10141014
children_idx = [
1015-
c.get_extra_idx(return_superset)
1015+
c.get_extra_idx(return_superset) # pyrefly: ignore[missing-attribute]
10161016
for c in self.children
10171017
if utils.is_metric(c)
10181018
]
@@ -1406,7 +1406,7 @@ def get_sql_and_with_clause(self, table, split_by, global_filter, indexes,
14061406
sql.Filters(self.where_).add(local_filter).remove(global_filter)
14071407
)
14081408
children_sql = [
1409-
c.get_sql_and_with_clause(table, split_by, global_filter, indexes,
1409+
c.get_sql_and_with_clause(table, split_by, global_filter, indexes, # pyrefly: ignore[missing-attribute]
14101410
local_filter, with_data)[0]
14111411
for c in self.children
14121412
]
@@ -1653,7 +1653,7 @@ def get_sql_and_with_clause(self, table, split_by, global_filter, indexes,
16531653

16541654
if not isinstance(self.children[0], Metric):
16551655
constant = self.children[0]
1656-
query, with_data = self.children[1].get_sql_and_with_clause(
1656+
query, with_data = self.children[1].get_sql_and_with_clause( # pyrefly: ignore[missing-attribute]
16571657
table, split_by, global_filter, indexes, local_filter, with_data)
16581658
query.columns = sql.Columns(
16591659
(c if c in indexes else op(constant, c) for c in query.columns))

‎models.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def __init__(
7777
'y must be a 1D array but is %iD!' % operations.count_features(y)
7878
)
7979
if isinstance(x, metrics.MetricList):
80-
x = list(x.children)
80+
x = list(x.children) # pyrefly: ignore[bad-assignment]
8181
elif isinstance(x, (metrics.Metric, str)):
8282
x = [x]
8383
elif x:

‎operations.py‎

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def get_sql_and_with_clause(self, table, split_by, global_filter, indexes,
254254
sql.Filters(self.where_).add(local_filter).remove(global_filter)
255255
)
256256
all_split_by = sql.Columns(split_by).add(self.extra_split_by)
257-
child_sql, with_data = self.children[0].get_sql_and_with_clause(
257+
child_sql, with_data = self.children[0].get_sql_and_with_clause( # pyrefly: ignore[missing-attribute]
258258
table, all_split_by, global_filter, indexes, local_filter, with_data)
259259
child_table = sql.Datasource(child_sql, 'DistributionRaw')
260260
child_table_alias = with_data.merge(child_table)
@@ -554,7 +554,7 @@ def get_change_raw_sql(
554554
sql.Filters(self.where_).add(local_filter).remove(global_filter)
555555
)
556556
groupby = sql.Columns(split_by).add(self.extra_split_by)
557-
raw_table_sql, with_data = self.children[0].get_sql_and_with_clause(
557+
raw_table_sql, with_data = self.children[0].get_sql_and_with_clause( # pyrefly: ignore[missing-attribute]
558558
table, groupby, global_filter, indexes, local_filter, with_data
559559
)
560560
return raw_table_sql, with_data
@@ -965,7 +965,7 @@ def get_change_raw_sql(
965965
)
966966
all_split_by = sql.Columns(split_by).add(self.extra_split_by)
967967
all_indexes = sql.Columns(split_by).add(self.extra_index)
968-
child_sql, with_data = self.children[0].get_sql_and_with_clause(
968+
child_sql, with_data = self.children[0].get_sql_and_with_clause( # pyrefly: ignore[missing-attribute]
969969
table, all_split_by, global_filter, indexes, local_filter, with_data)
970970
child_table = sql.Datasource(child_sql, 'PrePostRaw')
971971
child_table_alias = with_data.merge(child_table)
@@ -1036,7 +1036,7 @@ def get_equivalent_without_filter(self, *auxiliary_cols):
10361036
self.name_tmpl, # pyrefly: ignore[bad-argument-type]
10371037
)
10381038
for b, c in zip(self.child, self.covariates)
1039-
], where=self.children[0].where_)
1039+
], where=self.children[0].where_) # pyrefly: ignore[missing-attribute]
10401040

10411041

10421042
class CUPED(AbsoluteChange):
@@ -1308,7 +1308,7 @@ def get_change_raw_sql(
13081308
)
13091309
all_split_by = sql.Columns(split_by).add(self.extra_split_by)
13101310
all_indexes = sql.Columns(split_by).add(self.extra_index)
1311-
child_sql, with_data = self.children[0].get_sql_and_with_clause(
1311+
child_sql, with_data = self.children[0].get_sql_and_with_clause( # pyrefly: ignore[missing-attribute]
13121312
table, all_split_by, global_filter, indexes, local_filter, with_data)
13131313
child_table = sql.Datasource(child_sql, 'CUPEDRaw')
13141314
child_table_alias = with_data.merge(child_table)
@@ -1384,7 +1384,7 @@ def get_equivalent_without_filter(self, *auxiliary_cols):
13841384
self.name_tmpl, # pyrefly: ignore[bad-argument-type]
13851385
)
13861386
for b, c in zip(self.child, self.covariates)
1387-
], where=self.children[0].where_)
1387+
], where=self.children[0].where_) # pyrefly: ignore[missing-attribute]
13881388

13891389

13901390
class MH(Comparison):
@@ -1457,13 +1457,13 @@ def compute_children(self,
14571457
children = []
14581458
for m in child.children:
14591459
util_metric = metrics.MetricList(
1460-
[metrics.MetricList(m.children, where=m.where_)], where=child.where_
1460+
[metrics.MetricList(m.children, where=m.where_)], where=child.where_ # pyrefly: ignore[missing-attribute]
14611461
)
14621462
children.append(
14631463
self.compute_util_metric_on(
14641464
util_metric, df, split_by, cache_key=cache_key))
14651465
return children
1466-
util_metric = metrics.MetricList(child.children, where=child.where_)
1466+
util_metric = metrics.MetricList(child.children, where=child.where_) # pyrefly: ignore[missing-attribute]
14671467
return self.compute_util_metric_on(
14681468
util_metric, df, split_by, cache_key=cache_key)
14691469

@@ -1512,7 +1512,7 @@ def compute_children_sql(self, table, split_by=None, execute=None, mode=None):
15121512
children = []
15131513
for m in child.children:
15141514
util_metric = metrics.MetricList(
1515-
[metrics.MetricList(m.children, where=m.where_)], where=child.where_
1515+
[metrics.MetricList(m.children, where=m.where_)], where=child.where_ # pyrefly: ignore[missing-attribute]
15161516
)
15171517
c = self.compute_util_metric_on_sql(
15181518
util_metric,
@@ -1522,7 +1522,7 @@ def compute_children_sql(self, table, split_by=None, execute=None, mode=None):
15221522
mode=mode)
15231523
children.append(c)
15241524
return children
1525-
util_metric = metrics.MetricList(child.children, where=child.where_)
1525+
util_metric = metrics.MetricList(child.children, where=child.where_) # pyrefly: ignore[missing-attribute]
15261526
return self.compute_util_metric_on_sql(
15271527
util_metric, table, split_by + self.extra_split_by, execute, mode=mode) # pyrefly: ignore[unsupported-operation]
15281528

@@ -1598,7 +1598,7 @@ def get_sql_and_with_clause(self, table, split_by, global_filter, indexes,
15981598
grandchildren.append(metrics.MetricList(m.children, where=m.where_))
15991599
util_metric = metrics.MetricList(grandchildren, where=child.where_)
16001600
else:
1601-
util_metric = metrics.MetricList(child.children, where=child.where_)
1601+
util_metric = metrics.MetricList(child.children, where=child.where_) # pyrefly: ignore[missing-attribute]
16021602

16031603
cond_cols = sql.Columns(self.extra_index)
16041604
groupby = sql.Columns(split_by).add(self.extra_split_by)
@@ -1666,13 +1666,13 @@ def get_sql_and_with_clause(self, table, split_by, global_filter, indexes,
16661666
alias=alias_tmpl.format(c.name))) # pyrefly: ignore[missing-attribute]
16671667
else:
16681668
with_data2 = copy.deepcopy(with_data)
1669-
util = metrics.MetricList(child.children[:1], where=child.where_)
1669+
util = metrics.MetricList(child.children[:1], where=child.where_) # pyrefly: ignore[missing-attribute]
16701670
numer_sql, with_data2 = util.get_sql_and_with_clause(
16711671
table, groupby, global_filter, util_indexes, local_filter, with_data2)
16721672
with_data2.merge(sql.Datasource(numer_sql))
16731673
numer = numer_sql.columns[-1].alias
16741674
with_data2 = copy.deepcopy(with_data)
1675-
util = metrics.MetricList(child.children[1:], where=child.where_)
1675+
util = metrics.MetricList(child.children[1:], where=child.where_) # pyrefly: ignore[missing-attribute]
16761676
denom_sql, with_data2 = util.get_sql_and_with_clause(
16771677
table, groupby, global_filter, util_indexes, local_filter, with_data2)
16781678
with_data2.merge(sql.Datasource(denom_sql))
@@ -2048,7 +2048,7 @@ def compute_on_samples(
20482048
cache_key, sample = keyed_sample
20492049
if cache_key is None:
20502050
# If samples are unlikely to repeat, don't save res to self.cache.
2051-
res = self.children[0].compute_on(sample, split_by, melted=True)
2051+
res = self.children[0].compute_on(sample, split_by, melted=True) # pyrefly: ignore[missing-attribute]
20522052
else:
20532053
res = self.compute_child(
20542054
sample, split_by, melted=True, cache_key=cache_key
@@ -2517,7 +2517,7 @@ def get_sql_and_with_clause(
25172517
)
25182518
se_alias = with_data.merge(sql.Datasource(se, name + 'SE'))
25192519

2520-
pt_est, with_data = self.children[0].get_sql_and_with_clause(
2520+
pt_est, with_data = self.children[0].get_sql_and_with_clause( # pyrefly: ignore[missing-attribute]
25212521
table, split_by, global_filter, indexes, local_filter, with_data
25222522
)
25232523
pt_est_alias = with_data.merge(
@@ -2870,7 +2870,7 @@ def compute_children_sql(
28702870
m.name = m.var
28712871
leafs = metrics.MetricList(tuple(set(leafs)))
28722872
if len(leafs) == 1:
2873-
leafs.name = leafs.children[0].name
2873+
leafs.name = leafs.children[0].name # pyrefly: ignore[missing-attribute]
28742874
bucket_res = self.compute_util_metric_on_sql(
28752875
leafs, table, all_split_by, execute, mode=mode
28762876
)
@@ -3310,7 +3310,7 @@ def compute_children_sql(
33103310
resampled.with_data = with_data
33113311
replicates = []
33123312
for _ in range(self.n_replicates // batch_size):
3313-
bst = self.children[0].compute_on_sql(
3313+
bst = self.children[0].compute_on_sql( # pyrefly: ignore[missing-attribute]
33143314
resampled, ['meterstick_resample_idx'] + split_by, execute, True, mode
33153315
)
33163316
replicates.append(bst.unstack('meterstick_resample_idx'))
@@ -3325,7 +3325,7 @@ def compute_children_sql(
33253325
)
33263326
resampled = with_data2.children.popitem()[1]
33273327
resampled.with_data = with_data2
3328-
bst = self.children[0].compute_on_sql(
3328+
bst = self.children[0].compute_on_sql( # pyrefly: ignore[missing-attribute]
33293329
resampled, ['meterstick_resample_idx'] + split_by, execute, True, mode
33303330
)
33313331
replicates.append(bst.unstack('meterstick_resample_idx'))
@@ -4403,7 +4403,7 @@ def get_sql_and_with_clause(
44034403
local_filter = (
44044404
sql.Filters(self.where_).add(local_filter).remove(global_filter)
44054405
)
4406-
child_sql, with_data = self.children[0].get_sql_and_with_clause(
4406+
child_sql, with_data = self.children[0].get_sql_and_with_clause( # pyrefly: ignore[missing-attribute]
44074407
table, split_by, global_filter, indexes, local_filter, with_data)
44084408
columns = sql.Columns()
44094409
for c in child_sql.all_columns:
@@ -4576,7 +4576,7 @@ def _check_and_update_for_log_transformed_abs_change(self):
45764576
# Deepcopy the relevant parts of the tree to avoid modifying the original.
45774577
ci_method = copy.deepcopy(ci_method)
45784578
ab = ci_method.children[0]
4579-
log_transform = ab.children[0]
4579+
log_transform = ab.children[0] # pyrefly: ignore[missing-attribute]
45804580

45814581
self.name_tmpl = '{}'
45824582
log_transform = LogTransform(

‎utils.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,4 +697,4 @@ def pcollection_to_df_via_file_io(
697697
if not res:
698698
return pd.DataFrame()
699699
concat_res = pd.concat(res, ignore_index=True)
700-
return concat_res
700+
return concat_res # pyrefly: ignore[bad-return]

0 commit comments

Comments
 (0)