@@ -36,7 +36,8 @@ class CovidcastRow:
36
36
- converting from and to formats (dict, csv, df, kwargs)
37
37
- creating consistent views, with consistent data types (dict, csv, df)
38
38
39
- The rows are specified in 'v4_schema.sql'. The datatypes are made to match database. When writing to Pandas, the dtypes match the JIT model.py schema.
39
+ The rows are specified in 'v4_schema.sql'. The datatypes are made to match
40
+ database. When writing to Pandas, the dtypes match the JIT model.py schema.
40
41
"""
41
42
42
43
# Arguments.
@@ -55,7 +56,8 @@ class CovidcastRow:
55
56
missing_sample_size : int
56
57
issue : int
57
58
lag : int
58
- # The following three fields are only the database, but are not ingested at acquisition and not returned by the API.
59
+ # The following three fields are only in the database, but are not ingested at
60
+ # acquisition and not returned by the API.
59
61
epimetric_id : Optional [int ] = None
60
62
direction : Optional [int ] = None
61
63
value_updated_timestamp : Optional [int ] = 0
@@ -79,17 +81,20 @@ def as_dict(self, ignore_fields: Optional[List[str]] = None) -> dict:
79
81
return d
80
82
81
83
def as_api_row_dict (self , ignore_fields : Optional [List [str ]] = None ) -> dict :
82
- """Returns a dict view into the row with the fields returned by the API server."""
84
+ """Returns a dict view into the row with the fields returned by the API
85
+ server."""
83
86
return self .as_dict (ignore_fields = self ._api_row_ignore_fields + (ignore_fields or []))
84
87
85
88
def as_api_compatibility_row_dict (self , ignore_fields : Optional [List [str ]] = None ) -> dict :
86
- """Returns a dict view into the row with the fields returned by the old API server (the PHP server)."""
89
+ """Returns a dict view into the row with the fields returned by the old
90
+ API server (the PHP server)."""
87
91
return self .as_dict (
88
92
ignore_fields = self ._api_row_compatibility_ignore_fields + (ignore_fields or [])
89
93
)
90
94
91
95
def as_db_row_dict (self , ignore_fields : Optional [List [str ]] = None ) -> dict :
92
- """Returns a dict view into the row with the fields returned by the database."""
96
+ """Returns a dict view into the row with the fields returned by the
97
+ database."""
93
98
return self .as_dict (ignore_fields = self ._db_row_ignore_fields + (ignore_fields or []))
94
99
95
100
def as_dataframe (self , ignore_fields : Optional [List [str ]] = None ) -> pd .DataFrame :
@@ -99,19 +104,22 @@ def as_dataframe(self, ignore_fields: Optional[List[str]] = None) -> pd.DataFram
99
104
return df
100
105
101
106
def as_api_row_df (self , ignore_fields : Optional [List [str ]] = None ) -> pd .DataFrame :
102
- """Returns a dataframe view into the row with the fields returned by the API server."""
107
+ """Returns a dataframe view into the row with the fields returned by the
108
+ API server."""
103
109
return self .as_dataframe (ignore_fields = self ._api_row_ignore_fields + (ignore_fields or []))
104
110
105
- def as_api_compatibility_row_df (
106
- self , ignore_fields : Optional [List [str ]] = None
107
- ) -> pd .DataFrame :
108
- """Returns a dataframe view into the row with the fields returned by the old API server (the PHP server)."""
111
+ # fmt: off
112
+ def as_api_compatibility_row_df (self , ignore_fields : Optional [List [str ]] = None ) -> pd .DataFrame :
113
+ """Returns a dataframe view into the row with the fields returned by the
114
+ old API server (the PHP server)."""
115
+ # fmt: on
109
116
return self .as_dataframe (
110
117
ignore_fields = self ._api_row_compatibility_ignore_fields + (ignore_fields or [])
111
118
)
112
119
113
120
def as_db_row_df (self , ignore_fields : Optional [List [str ]] = None ) -> pd .DataFrame :
114
- """Returns a dataframe view into the row with the fields returned by an all-field database query."""
121
+ """Returns a dataframe view into the row with the fields returned by an
122
+ all-field database query."""
115
123
return self .as_dataframe (ignore_fields = self ._db_row_ignore_fields + (ignore_fields or []))
116
124
117
125
def signal_pair (self ):
0 commit comments