@@ -34,7 +34,7 @@ def __init__(
34
34
* ,
35
35
predicateHints : Optional [Sequence [str ]] = None ,
36
36
limit : Optional [int ] = None ,
37
- sampleFraction : Optional [float ] = None ,
37
+ sampleHint : Optional [float ] = None ,
38
38
):
39
39
self ._table = table
40
40
self ._rest_client = rest_client
@@ -48,26 +48,26 @@ def __init__(
48
48
assert isinstance (limit , int ) and limit >= 0 , "'limit' must be a non-negative int"
49
49
self ._limit = limit
50
50
51
- if sampleFraction is not None :
52
- assert isinstance (sampleFraction , float ) and sampleFraction >= 0.0 and sampleFraction <= 1.0 , "'sampleFraction ' must be between 0.0 and 1.0"
53
- self ._sampleFraction = sampleFraction
51
+ if sampleHint is not None :
52
+ assert isinstance (sampleHint , float ) and sampleHint >= 0.0 and sampleHint <= 1.0 , "'sampleHint ' must be between 0.0 and 1.0"
53
+ self ._sampleHint = sampleHint
54
54
55
55
@property
56
56
def table (self ) -> Table :
57
57
return self ._table
58
58
59
59
def predicateHints (self , predicateHints : Optional [Sequence [str ]]) -> "DeltaSharingReader" :
60
- return self ._copy (predicateHints = predicateHints , limit = self ._limit , sampleFraction = self ._sampleFraction )
60
+ return self ._copy (predicateHints = predicateHints , limit = self ._limit , sampleHint = self ._sampleHint )
61
61
62
62
def limit (self , limit : Optional [int ]) -> "DeltaSharingReader" :
63
- return self ._copy (predicateHints = self ._predicateHints , limit = limit , sampleFraction = self ._sampleFraction )
63
+ return self ._copy (predicateHints = self ._predicateHints , limit = limit , sampleHint = self ._sampleHint )
64
64
65
- def sample (self , sampleFraction : Optional [float ]) -> "DeltaSharingReader" :
66
- return self ._copy (predicateHints = self ._predicateHints , limit = self ._limit , sampleFraction = sampleFraction )
65
+ def sample (self , sampleHint : Optional [float ]) -> "DeltaSharingReader" :
66
+ return self ._copy (predicateHints = self ._predicateHints , limit = self ._limit , sampleHint = sampleHint )
67
67
68
68
def to_pandas (self ) -> pd .DataFrame :
69
69
response = self ._rest_client .list_files_in_table (
70
- self ._table , predicateHints = self ._predicateHints , limitHint = self ._limit , sampleFraction = self ._sampleFraction
70
+ self ._table , predicateHints = self ._predicateHints , limitHint = self ._limit , sampleHint = self ._sampleHint
71
71
)
72
72
73
73
schema_json = loads (response .metadata .schema_string )
@@ -102,14 +102,14 @@ def to_pandas(self) -> pd.DataFrame:
102
102
)[[field ["name" ] for field in schema_json ["fields" ]]]
103
103
104
104
def _copy (
105
- self , * , predicateHints : Optional [Sequence [str ]], limit : Optional [int ], sampleFraction : Optional [float ]
105
+ self , * , predicateHints : Optional [Sequence [str ]], limit : Optional [int ], sampleHint : Optional [float ]
106
106
) -> "DeltaSharingReader" :
107
107
return DeltaSharingReader (
108
108
table = self ._table ,
109
109
rest_client = self ._rest_client ,
110
110
predicateHints = predicateHints ,
111
111
limit = limit ,
112
- sampleFraction = sampleFraction ,
112
+ sampleHint = sampleHint ,
113
113
)
114
114
115
115
@staticmethod
0 commit comments