Dataset reference
Bases: Generic[_FormatT]
File or object-store resource that Beacon can scan directly.
The class acts as a light-weight descriptor containing the user's
original file_path plus convenience methods to inspect schema
information and kick off JSON query builders.
Source code in beacon_api/dataset.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | |
__init__(http_session, file_path, file_format)
Create a dataset descriptor.
Args:
http_session: Session that knows how to communicate with the Beacon Node.
file_path: Absolute/relative path or URI that Beacon can read.
file_format: File format string supported by Beacon (e.g. parquet).
Source code in beacon_api/dataset.py
get_file_extension()
Return the lowercase file extension without the leading dot.
get_file_format()
get_file_name()
get_file_path()
get_schema()
Fetch the dataset schema by calling the Beacon Node.
Returns:
SchemaType: JSON-compatible schema description mirroring the
server's /api/dataset-schema payload.
Raises: RuntimeError: If the HTTP request fails. ValueError: When the response body is not valid JSON or the decoded value is not a JSON object. Exception: For unsupported field types surfaced by Beacon.
Source code in beacon_api/dataset.py
query(*, delimiter=None, statistics_columns=None, **kwargs)
Build a :class:~beacon_api.query.JSONQuery starting from this dataset.
Args: delimiter: Optional CSV delimiter override (only valid for CSV datasets). statistics_columns: Optional Zarr statistics column names (only valid for Zarr datasets). **kwargs: Additional format-specific options forwarded to the query builder.
Returns: JSONQuery: Query builder tied to this dataset source.
Raises: ValueError: If a format-specific option is passed to the wrong dataset type or the format is not supported.