Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Refactor episode data loading to support v3.0 structure and enhance video player segmentation features. Added debug logging for version checks and data loading processes (will remove later).
Browse filesFiles changed (5)
213 unmodified lines214215216217218219220221222223224225226227213 unmodified linesonChartsReady={() => setChartsReady(true)}/>{ignoredColumns.length > 0 && (<p className="mt-2 text-orange-700">Columns{" "}<span className="font-mono">{ignoredColumns.join(", ")}</span> areNOT shown since the visualizer currently does not support 2D or 3Ddata.</p>)}</div><PlaybackBar />213 unmodified lines214215216217218219213 unmodified linesonChartsReady={() => setChartsReady(true)}/></div><PlaybackBar />
19 unmodified lines202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127219 unmodified lines) {const repoId = `${org}/${dataset}`;try {const episode_chunk = Math.floor(0 / 1000);// Check for compatible dataset version (v2.1 or v2.0)const version = await getDatasetVersion(repoId);const jsonUrl = buildVersionedUrl(repoId, version, "meta/info.json");const info = await fetchJson<DatasetMetadata>(jsonUrl);// Dataset informationconst datasetInfo = {repoId,total_frames: info.total_frames,total_episodes: info.total_episodes,fps: info.fps,};// Generate list of episodesconst episodes =process.env.EPISODES === undefined? Array.from({ length: datasetInfo.total_episodes },// episode id starts from 0(_, i) => i,): process.env.EPISODES.split(/\s+/).map((x) => parseInt(x.trim(), 10)).filter((x) => !isNaN(x));// Videos informationconst videosInfo = Object.entries(info.features).filter(([key, value]) => value.dtype === "video").map(([key, _]) => {const videoPath = formatStringWithVars(info.video_path, {video_key: key,episode_chunk: episode_chunk.toString().padStart(3, "0"),episode_index: episodeId.toString().padStart(6, "0"),});return {filename: key,url: buildVersionedUrl(repoId, version, videoPath),};});// Column dataconst columnNames = Object.entries(info.features).filter(([key, value]) =>["float32", "int32"].includes(value.dtype) &&value.shape.length === 1,).map(([key, { shape }]) => ({ key, length: shape[0] }));// Exclude specific columnsconst excludedColumns = ["timestamp","frame_index","episode_index","index","task_index",];const filteredColumns = columnNames.filter((column) => !excludedColumns.includes(column.key),);const filteredColumnNames = ["timestamp",...filteredColumns.map((column) => column.key),];const columns = filteredColumns.map(({ key }) => {let column_names = info.features[key].names;while (typeof column_names === "object") {if (Array.isArray(column_names)) break;column_names = Object.values(column_names ?? {})[0];}return {key,value: Array.isArray(column_names)? column_names.map((name) => `${key}${SERIES_NAME_DELIMITER}${name}`): Array.from({ length: columnNames.find((c) => c.key === key)?.length ?? 1 },(_, i) => `${key}${SERIES_NAME_DELIMITER}${i}`,),};});const parquetUrl = buildVersionedUrl(repoId,version,formatStringWithVars(info.data_path, {episode_chunk: episode_chunk.toString().padStart(3, "0"),episode_index: episodeId.toString().padStart(6, "0"),}));const arrayBuffer = await fetchParquetFile(parquetUrl);const data = await readParquetColumn(arrayBuffer, filteredColumnNames);// Flatten and map to array of objects for chartDataconst seriesNames = ["timestamp",...columns.map(({ value }) => value).flat(),];const chartData = data.map((row) => {const flatRow = row.flat();const obj: Record<string, number> = {};seriesNames.forEach((key, idx) => {obj[key] = flatRow[idx];});return obj;});// List of columns that are ignored (e.g., 2D or 3D data)const ignoredColumns = Object.entries(info.features).filter(([key, value]) =>["float32", "int32"].includes(value.dtype) && value.shape.length > 1,).map(([key]) => key);// 1. Group all numeric keys by suffix (excluding 'timestamp')const numericKeys = seriesNames.filter((k) => k !== "timestamp");const suffixGroupsMap: Record<string, string[]> = {};for (const key of numericKeys) {const parts = key.split(SERIES_NAME_DELIMITER);const suffix = parts[1] || parts[0]; // fallback to key if no delimiterif (!suffixGroupsMap[suffix]) suffixGroupsMap[suffix] = [];suffixGroupsMap[suffix].push(key);}const suffixGroups = Object.values(suffixGroupsMap);// 2. Compute min/max for each suffix group as a wholeconst groupStats: Record<string, { min: number; max: number }> = {};suffixGroups.forEach((group) => {let min = Infinity,max = -Infinity;for (const row of chartData) {for (const key of group) {const v = row[key];if (typeof v === "number" && !isNaN(v)) {if (v < min) min = v;if (v > max) max = v;}}}// Use the first key in the group as the group idgroupStats[group[0]] = { min, max };});// 3. Group suffix groups by similar scale (treat each suffix group as a unit)const scaleGroups: Record<string, string[][]> = {};const used = new Set<string>();const SCALE_THRESHOLD = 2;for (const group of suffixGroups) {const groupId = group[0];if (used.has(groupId)) continue;const { min, max } = groupStats[groupId];if (!isFinite(min) || !isFinite(max)) continue;const logMin = Math.log10(Math.abs(min) + 1e-9);const logMax = Math.log10(Math.abs(max) + 1e-9);const unit: string[][] = [group];used.add(groupId);for (const other of suffixGroups) {const otherId = other[0];if (used.has(otherId) || otherId === groupId) continue;const { min: omin, max: omax } = groupStats[otherId];if (!isFinite(omin) || !isFinite(omax) || omin === omax) continue;const ologMin = Math.log10(Math.abs(omin) + 1e-9);const ologMax = Math.log10(Math.abs(omax) + 1e-9);if (Math.abs(logMin - ologMin) <= SCALE_THRESHOLD &&Math.abs(logMax - ologMax) <= SCALE_THRESHOLD) {unit.push(other);used.add(otherId);}}scaleGroups[groupId] = unit;}// 4. Flatten scaleGroups into chartGroups (array of arrays of keys)const chartGroups: string[][] = Object.values(scaleGroups).sort((a, b) => b.length - a.length).flatMap((suffixGroupArr) => {// suffixGroupArr is array of suffix groups (each is array of keys)const merged = suffixGroupArr.flat();if (merged.length > 6) {const subgroups = [];for (let i = 0; i < merged.length; i += 6) {subgroups.push(merged.slice(i, i + 6));}return subgroups;}return [merged];});const duration = chartData[chartData.length - 1].timestamp;// Utility: group row keys by suffixfunction groupRowBySuffix(row: Record<string, number>): Record<string, any> {const result: Record<string, any> = {};const suffixGroups: Record<string, Record<string, number>> = {};for (const [key, value] of Object.entries(row)) {if (key === "timestamp") {result["timestamp"] = value;continue;}const parts = key.split(SERIES_NAME_DELIMITER);if (parts.length === 2) {const [prefix, suffix] = parts;if (!suffixGroups[suffix]) suffixGroups[suffix] = {};suffixGroups[suffix][prefix] = value;} else {result[key] = value;}}for (const [suffix, group] of Object.entries(suffixGroups)) {const keys = Object.keys(group);if (keys.length === 1) {// Use the full original name as the keyconst fullName = `${keys[0]}${SERIES_NAME_DELIMITER}${suffix}`;result[fullName] = group[keys[0]];} else {result[suffix] = group;}}return result;}const chartDataGroups = chartGroups.map((group) =>chartData.map((row) => groupRowBySuffix(pick(row, [...group, "timestamp"]))));return {datasetInfo,episodeId,videosInfo,chartDataGroups,episodes,ignoredColumns,duration,};} catch (err) {console.error("Error loading episode data:", err);throw err;}}// Safe wrapper for UI error displayexport async function getEpisodeDataSafe(19 unmodified lines202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996019 unmodified lines) {const repoId = `${org}/${dataset}`;try {// Check for compatible dataset version (v3.0, v2.1, or v2.0)const version = await getDatasetVersion(repoId);console.log(`[DEBUG] Detected dataset version: ${version} for ${repoId}`);const jsonUrl = buildVersionedUrl(repoId, version, "meta/info.json");const info = await fetchJson<DatasetMetadata>(jsonUrl);// Handle different versionsif (version === "v3.0") {console.log(`[DEBUG] Using v3.0 data loader for ${repoId}`);return await getEpisodeDataV3(repoId, version, info, episodeId);} else {console.log(`[DEBUG] Using v2.x data loader for ${repoId} (version: ${version})`);return await getEpisodeDataV2(repoId, version, info, episodeId);}} catch (err) {console.error("Error loading episode data:", err);throw err;}}// Legacy v2.x data loadingasync function getEpisodeDataV2(repoId: string,version: string,info: DatasetMetadata,episodeId: number,) {const episode_chunk = Math.floor(0 / 1000);// Dataset informationconst datasetInfo = {repoId,total_frames: info.total_frames,total_episodes: info.total_episodes,fps: info.fps,};// Generate list of episodesconst episodes =process.env.EPISODES === undefined? Array.from({ length: datasetInfo.total_episodes },// episode id starts from 0(_, i) => i,): process.env.EPISODES.split(/\s+/).map((x) => parseInt(x.trim(), 10)).filter((x) => !isNaN(x));// Videos informationconst videosInfo = Object.entries(info.features).filter(([key, value]) => value.dtype === "video").map(([key, _]) => {const videoPath = formatStringWithVars(info.video_path, {video_key: key,episode_chunk: episode_chunk.toString().padStart(3, "0"),episode_index: episodeId.toString().padStart(6, "0"),});return {filename: key,url: buildVersionedUrl(repoId, version, videoPath),};});// Column dataconst columnNames = Object.entries(info.features).filter(([key, value]) =>["float32", "int32"].includes(value.dtype) &&value.shape.length === 1,).map(([key, { shape }]) => ({ key, length: shape[0] }));// Exclude specific columnsconst excludedColumns = ["timestamp","frame_index","episode_index","index","task_index",];const filteredColumns = columnNames.filter((column) => !excludedColumns.includes(column.key),);const filteredColumnNames = ["timestamp",...filteredColumns.map((column) => column.key),];const columns = filteredColumns.map(({ key }) => {let column_names = info.features[key].names;while (typeof column_names === "object") {if (Array.isArray(column_names)) break;column_names = Object.values(column_names ?? {})[0];}return {key,value: Array.isArray(column_names)? column_names.map((name) => `${key}${SERIES_NAME_DELIMITER}${name}`): Array.from({ length: columnNames.find((c) => c.key === key)?.length ?? 1 },(_, i) => `${key}${SERIES_NAME_DELIMITER}${i}`,),};});const parquetUrl = buildVersionedUrl(repoId,version,formatStringWithVars(info.data_path, {episode_chunk: episode_chunk.toString().padStart(3, "0"),episode_index: episodeId.toString().padStart(6, "0"),}));const arrayBuffer = await fetchParquetFile(parquetUrl);const data = await readParquetColumn(arrayBuffer, filteredColumnNames);// Flatten and map to array of objects for chartDataconst seriesNames = ["timestamp",...columns.map(({ value }) => value).flat(),];const chartData = data.map((row) => {const flatRow = row.flat();const obj: Record<string, number> = {};seriesNames.forEach((key, idx) => {obj[key] = flatRow[idx];});return obj;});// List of columns that are ignored (e.g., 2D or 3D data)const ignoredColumns = Object.entries(info.features).filter(([key, value]) =>["float32", "int32"].includes(value.dtype) && value.shape.length > 1,).map(([key]) => key);// 1. Group all numeric keys by suffix (excluding 'timestamp')const numericKeys = seriesNames.filter((k) => k !== "timestamp");const suffixGroupsMap: Record<string, string[]> = {};for (const key of numericKeys) {const parts = key.split(SERIES_NAME_DELIMITER);const suffix = parts[1] || parts[0]; // fallback to key if no delimiterif (!suffixGroupsMap[suffix]) suffixGroupsMap[suffix] = [];suffixGroupsMap[suffix].push(key);}const suffixGroups = Object.values(suffixGroupsMap);// 2. Compute min/max for each suffix group as a wholeconst groupStats: Record<string, { min: number; max: number }> = {};suffixGroups.forEach((group) => {let min = Infinity,max = -Infinity;for (const row of chartData) {for (const key of group) {const v = row[key];if (typeof v === "number" && !isNaN(v)) {if (v < min) min = v;if (v > max) max = v;}}}// Use the first key in the group as the group idgroupStats[group[0]] = { min, max };});// 3. Group suffix groups by similar scale (treat each suffix group as a unit)const scaleGroups: Record<string, string[][]> = {};const used = new Set<string>();const SCALE_THRESHOLD = 2;for (const group of suffixGroups) {const groupId = group[0];if (used.has(groupId)) continue;const { min, max } = groupStats[groupId];if (!isFinite(min) || !isFinite(max)) continue;const logMin = Math.log10(Math.abs(min) + 1e-9);const logMax = Math.log10(Math.abs(max) + 1e-9);const unit: string[][] = [group];used.add(groupId);for (const other of suffixGroups) {const otherId = other[0];if (used.has(otherId) || otherId === groupId) continue;const { min: omin, max: omax } = groupStats[otherId];if (!isFinite(omin) || !isFinite(omax) || omin === omax) continue;const ologMin = Math.log10(Math.abs(omin) + 1e-9);const ologMax = Math.log10(Math.abs(omax) + 1e-9);if (Math.abs(logMin - ologMin) <= SCALE_THRESHOLD &&Math.abs(logMax - ologMax) <= SCALE_THRESHOLD) {unit.push(other);used.add(otherId);}}scaleGroups[groupId] = unit;}// 4. Flatten scaleGroups into chartGroups (array of arrays of keys)const chartGroups: string[][] = Object.values(scaleGroups).sort((a, b) => b.length - a.length).flatMap((suffixGroupArr) => {// suffixGroupArr is array of suffix groups (each is array of keys)const merged = suffixGroupArr.flat();if (merged.length > 6) {const subgroups = [];for (let i = 0; i < merged.length; i += 6) {subgroups.push(merged.slice(i, i + 6));}return subgroups;}return [merged];});const duration = chartData[chartData.length - 1].timestamp;// Utility: group row keys by suffixfunction groupRowBySuffix(row: Record<string, number>): Record<string, any> {const result: Record<string, any> = {};const suffixGroups: Record<string, Record<string, number>> = {};for (const [key, value] of Object.entries(row)) {if (key === "timestamp") {result["timestamp"] = value;continue;}const parts = key.split(SERIES_NAME_DELIMITER);if (parts.length === 2) {const [prefix, suffix] = parts;if (!suffixGroups[suffix]) suffixGroups[suffix] = {};suffixGroups[suffix][prefix] = value;} else {result[key] = value;}}for (const [suffix, group] of Object.entries(suffixGroups)) {const keys = Object.keys(group);if (keys.length === 1) {// Use the full original name as the keyconst fullName = `${keys[0]}${SERIES_NAME_DELIMITER}${suffix}`;result[fullName] = group[keys[0]];} else {result[suffix] = group;}}return result;}const chartDataGroups = chartGroups.map((group) =>chartData.map((row) => groupRowBySuffix(pick(row, [...group, "timestamp"]))));return {datasetInfo,episodeId,videosInfo,chartDataGroups,episodes,ignoredColumns,duration,};}// v3.0 implementation with segmentation support for all episodesasync function getEpisodeDataV3(repoId: string,version: string,info: DatasetMetadata,episodeId: number,) {console.log(`[DEBUG] Loading v3.0 episode data for ${repoId}, episode ${episodeId}`);// Create dataset info structure (like v2.x)const datasetInfo = {repoId,total_frames: info.total_frames,total_episodes: info.total_episodes,fps: info.fps,};// Generate episodes list based on total_episodes from dataset infoconst episodes = Array.from({ length: info.total_episodes }, (_, i) => i);console.log(`[DEBUG] Available episodes: ${episodes.length} (0 to ${episodes.length - 1})`);// Load episode metadata to get timestamps for episode 0const episodeMetadata = await loadEpisodeMetadataV3Simple(repoId, version, episodeId);// Create video info with segmentation using the metadataconst videosInfo = extractVideoInfoV3WithSegmentation(repoId, version, info, episodeMetadata);// Load episode data for chartsconst { chartDataGroups, ignoredColumns } = await loadEpisodeDataV3(repoId, version, info, episodeMetadata);return {datasetInfo,episodeId,videosInfo,chartDataGroups,episodes,ignoredColumns,duration: episodeMetadata.video_to_timestamp - episodeMetadata.video_from_timestamp, // Use actual episode duration};}// Load episode data for v3.0 chartsasync function loadEpisodeDataV3(repoId: string,version: string,info: DatasetMetadata,episodeMetadata: any,): Promise<{ chartDataGroups: any[]; ignoredColumns: string[] }> {console.log(`[DEBUG] Loading v3.0 data for episode ${episodeMetadata.episode_index}`);// Build data file path using chunk and file indicesconst dataChunkIndex = episodeMetadata.data_chunk_index || 0;const dataFileIndex = episodeMetadata.data_file_index || 0;const dataPath = `data/chunk-${dataChunkIndex.toString().padStart(3, "0")}/file-${dataFileIndex.toString().padStart(3, "0")}.parquet`;console.log(`[DEBUG] Loading data from: ${dataPath}`);console.log(`[DEBUG] Data range: ${episodeMetadata.dataset_from_index} to ${episodeMetadata.dataset_to_index}`);try {const dataUrl = buildVersionedUrl(repoId, version, dataPath);const arrayBuffer = await fetchParquetFile(dataUrl);const fullData = await readParquetColumn(arrayBuffer, []);console.log(`[DEBUG] Loaded ${fullData.length} total data rows`);// Extract the episode-specific data slice// Convert BigInt to number if neededconst fromIndex = Number(episodeMetadata.dataset_from_index || 0);const toIndex = Number(episodeMetadata.dataset_to_index || fullData.length);console.log(`[DEBUG] Converting indices: ${episodeMetadata.dataset_from_index} → ${fromIndex}, ${episodeMetadata.dataset_to_index} → ${toIndex}`);const episodeData = fullData.slice(fromIndex, toIndex);console.log(`[DEBUG] Episode data slice: ${episodeData.length} rows (${fromIndex} to ${toIndex})`);if (episodeData.length === 0) {console.log(`[DEBUG] No data found for episode ${episodeMetadata.episode_index}`);return { chartDataGroups: [], ignoredColumns: [] };}// Convert to the same format as v2.x for compatibility with existing chart codeconst { chartDataGroups, ignoredColumns } = processEpisodeDataForCharts(episodeData, info, episodeMetadata);return { chartDataGroups, ignoredColumns };} catch (error) {console.error(`[DEBUG] Failed to load episode data:`, error);return { chartDataGroups: [], ignoredColumns: [] };}}// Process episode data for charts (v3.0 compatible)function processEpisodeDataForCharts(episodeData: any[],info: DatasetMetadata,episodeMetadata?: any,): { chartDataGroups: any[]; ignoredColumns: string[] } {const SERIES_NAME_DELIMITER = ".";// Get numeric column featuresconst columnNames = Object.entries(info.features).filter(([key, value]) =>["float32", "int32"].includes(value.dtype) &&value.shape.length === 1,).map(([key, value]) => ({ key, value }));// Convert parquet data to chart formatlet seriesNames: string[] = [];// Create a mapping from numeric indices to feature names for v3.0 dataconst v3IndexToFeatureMap: Record<string, string> = {'0': 'observation.state','1': 'action','2': 'timestamp','3': 'episode_index','4': 'frame_index','5': 'next.reward','6': 'next.done','7': 'index','8': 'task_index'};// Columns to exclude from chartsconst excludedColumns = ['index', 'task_index', 'episode_index', 'frame_index'];// First, extract all series from the first data row to understand the structureif (episodeData.length > 0) {const firstRow = episodeData[0];const allKeys: string[] = [];Object.entries(firstRow || {}).forEach(([key, value]) => {if (key === 'timestamp') return; // Skip timestamp, we'll add it separately// Map numeric key to feature name if availableconst featureName = v3IndexToFeatureMap[key] || key;// Skip excluded columnsif (excludedColumns.includes(featureName)) return;if (Array.isArray(value) && value.length > 0) {// For array values like observation.state and action, create a key for each elementvalue.forEach((_, idx) => {allKeys.push(`${featureName}[${idx}]`);});} else if (typeof value === 'number' && !isNaN(value)) {// For scalar numeric valuesallKeys.push(featureName);} else if (typeof value === 'bigint') {// For BigInt valuesallKeys.push(featureName);}});seriesNames = ["timestamp", ...allKeys];console.log(`[DEBUG] Detected series:`, allKeys);console.log(`[DEBUG] First row sample:`, firstRow);} else {// Fallback to feature-based approachseriesNames = ["timestamp",...columnNames.map(({ key }) => key),];}const chartData = episodeData.map((row, index) => {const obj: Record<string, number> = {};// Add timestamp aligned with video timing// For v3.0, we need to map the episode data index to the actual video durationlet videoDuration = episodeData.length; // Fallback to data lengthif (episodeMetadata) {// Use actual video segment duration if availablevideoDuration = (episodeMetadata.video_to_timestamp || 30) - (episodeMetadata.video_from_timestamp || 0);}obj["timestamp"] = (index / Math.max(episodeData.length - 1, 1)) * videoDuration;// For v3.0, data might have numeric string keys, so we need to map them// Get all available keys from the first row to understand the structureif (index === 0) {console.log(`[DEBUG] Data row keys:`, Object.keys(row || {}));console.log(`[DEBUG] Available features:`, Object.keys(info.features));}// Add all data columnsif (row && typeof row === 'object') {Object.entries(row).forEach(([key, value]) => {if (key === 'timestamp') {// Timestamp is already handled abovereturn;}// Map numeric key to feature name if availableconst featureName = v3IndexToFeatureMap[key] || key;// Skip excluded columnsif (excludedColumns.includes(featureName)) return;if (Array.isArray(value)) {// For array values like observation.state and actionvalue.forEach((val, idx) => {const elementKey = `${featureName}[${idx}]`;obj[elementKey] = typeof val === 'number' ? val : Number(val);});} else if (typeof value === 'number' && !isNaN(value)) {obj[featureName] = value;} else if (typeof value === 'bigint') {obj[featureName] = Number(value);} else if (typeof value === 'boolean') {// Convert boolean to number for chartsobj[featureName] = value ? 1 : 0;}});}return obj;});// List of columns that are ignored (now we handle 2D data by flattening)const ignoredColumns = [...Object.entries(info.features).filter(([key, value]) =>["float32", "int32"].includes(value.dtype) && value.shape.length > 2, // Only ignore 3D+ data).map(([key]) => key),...excludedColumns // Also include the manually excluded columns];// Group processing logic (adapted for v3.0 numeric keys)const numericKeys = seriesNames.filter((k) => k !== "timestamp");// Group keys by prefix (for hierarchical structure like v2)const suffixGroupsMap: Record<string, string[]> = {};// First, let's check if we have keys with dots (hierarchical structure)const hasHierarchicalKeys = numericKeys.some(key => key.includes('.') && !key.includes('['));if (hasHierarchicalKeys) {// Group by suffix after the dot (like v2 does)for (const key of numericKeys) {const cleanKey = key.replace(/\[\d+\]$/, ''); // Remove array indicesconst parts = cleanKey.split('.');if (parts.length >= 2) {// For keys like "observation.state" or "action.main_shoulder_pan"const suffix = parts.slice(1).join('.'); // Everything after first dotif (!suffixGroupsMap[suffix]) {suffixGroupsMap[suffix] = [];}suffixGroupsMap[suffix].push(key);} else {// Keys without dots go in their own groupif (!suffixGroupsMap[key]) {suffixGroupsMap[key] = [];}suffixGroupsMap[key].push(key);}}} else {// For v3 data without hierarchical keys, group by base name (removing array indices)for (const key of numericKeys) {const baseKey = key.replace(/\[\d+\]$/, '');if (!suffixGroupsMap[baseKey]) {suffixGroupsMap[baseKey] = [];}suffixGroupsMap[baseKey].push(key);}}const suffixGroups = Object.values(suffixGroupsMap);console.log(`[DEBUG] Created suffix groups:`, suffixGroupsMap);// Compute min/max for each suffix groupconst groupStats: Record<string, { min: number; max: number }> = {};suffixGroups.forEach((group) => {let min = Infinity, max = -Infinity;for (const row of chartData) {for (const key of group) {const v = row[key];if (typeof v === "number" && !isNaN(v)) {if (v < min) min = v;if (v > max) max = v;}}}groupStats[group[0]] = { min, max };});// Group by similar scaleconst scaleGroups: Record<string, string[][]> = {};const used = new Set<string>();const SCALE_THRESHOLD = 2;for (const group of suffixGroups) {const groupId = group[0];if (used.has(groupId)) continue;const { min, max } = groupStats[groupId];if (!isFinite(min) || !isFinite(max)) continue;const logMin = Math.log10(Math.abs(min) + 1e-9);const logMax = Math.log10(Math.abs(max) + 1e-9);const unit: string[][] = [group];used.add(groupId);for (const other of suffixGroups) {const otherId = other[0];if (used.has(otherId) || otherId === groupId) continue;const { min: omin, max: omax } = groupStats[otherId];if (!isFinite(omin) || !isFinite(omax) || omin === omax) continue;const ologMin = Math.log10(Math.abs(omin) + 1e-9);const ologMax = Math.log10(Math.abs(omax) + 1e-9);if (Math.abs(logMin - ologMin) <= SCALE_THRESHOLD &&Math.abs(logMax - ologMax) <= SCALE_THRESHOLD) {unit.push(other);used.add(otherId);}}scaleGroups[groupId] = unit;}// Flatten into chartGroupsconst chartGroups: string[][] = Object.values(scaleGroups).sort((a, b) => b.length - a.length).flatMap((suffixGroupArr) => {const merged = suffixGroupArr.flat();if (merged.length > 6) {const subgroups = [];for (let i = 0; i < merged.length; i += 6) {subgroups.push(merged.slice(i, i + 6));}return subgroups;}return [merged];});// Utility function to group row keys by suffixfunction groupRowBySuffix(row: Record<string, number>): Record<string, any> {const result: Record<string, any> = {};// Check if we have hierarchical keysconst hasHierarchicalKeys = Object.keys(row).some(key => key.includes('.') && !key.includes('[') && key !== 'timestamp');if (hasHierarchicalKeys) {// Group by prefix for hierarchical displayconst prefixGroups: Record<string, Record<string, number>> = {};for (const [key, value] of Object.entries(row)) {if (key === "timestamp") {result["timestamp"] = value;continue;}const cleanKey = key.replace(/\[\d+\]$/, ''); // Remove array indicesconst parts = cleanKey.split('.');if (parts.length >= 2) {const prefix = parts[0];const suffix = parts.slice(1).join('.');if (!prefixGroups[suffix]) {prefixGroups[suffix] = {};}// Store with the prefix as keyprefixGroups[suffix][prefix] = value;} else {// Non-hierarchical keys go directly to resultresult[key] = value;}}// Add grouped data to resultfor (const [suffix, group] of Object.entries(prefixGroups)) {const keys = Object.keys(group);if (keys.length === 1) {// Single value, use full nameresult[`${keys[0]}.${suffix}`] = group[keys[0]];} else {// Multiple values, create nested structureresult[suffix] = group;}}} else {// For non-hierarchical data, just pass throughfor (const [key, value] of Object.entries(row)) {result[key] = value;}}return result;}const chartDataGroups = chartGroups.map((group) =>chartData.map((row) => groupRowBySuffix(pick(row, [...group, "timestamp"]))));console.log(`[DEBUG] Generated ${chartDataGroups.length} chart groups`);console.log(`[DEBUG] Chart groups structure:`, chartGroups);if (chartDataGroups.length > 0 && chartDataGroups[0].length > 0) {console.log(`[DEBUG] Sample chart data:`, chartDataGroups[0][0]);}return { chartDataGroups, ignoredColumns };}// Simplified video info extraction for v3.0 - just use first chunk filesfunction extractSimpleVideoInfoV3(repoId: string,version: string,info: DatasetMetadata,): any[] {// Get video features from dataset infoconst videoFeatures = Object.entries(info.features).filter(([key, value]) => value.dtype === "video");const videosInfo = videoFeatures.map(([videoKey, _]) => {// For simplified version, just use chunk-000/file-000.mp4const videoPath = `videos/${videoKey}/chunk-000/file-000.mp4`;return {filename: videoKey,url: buildVersionedUrl(repoId, version, videoPath),// No segmentation - just show the full video fileisSegmented: false,};});return videosInfo;}// Video info extraction with segmentation for v3.0function extractVideoInfoV3WithSegmentation(repoId: string,version: string,info: DatasetMetadata,episodeMetadata: any,): any[] {// Get video features from dataset infoconst videoFeatures = Object.entries(info.features).filter(([key, value]) => value.dtype === "video");const videosInfo = videoFeatures.map(([videoKey, _]) => {// Use chunk and file indices from metadataconst chunkIndex = episodeMetadata.video_chunk_index || 0;const fileIndex = episodeMetadata.video_file_index || 0;const videoPath = `videos/${videoKey}/chunk-${chunkIndex.toString().padStart(3, "0")}/file-${fileIndex.toString().padStart(3, "0")}.mp4`;const fullUrl = buildVersionedUrl(repoId, version, videoPath);console.log(`[DEBUG] Video URL for ${videoKey}: ${fullUrl}`);console.log(`[DEBUG] Chunk index: ${chunkIndex}, File index: ${fileIndex}`);console.log(`[DEBUG] Timestamps: ${episodeMetadata.video_from_timestamp} to ${episodeMetadata.video_to_timestamp}`);return {filename: videoKey,url: fullUrl,// Enable segmentation with timestamps from metadataisSegmented: true,segmentStart: episodeMetadata.video_from_timestamp || 0,segmentEnd: episodeMetadata.video_to_timestamp || 30,segmentDuration: (episodeMetadata.video_to_timestamp || 30) - (episodeMetadata.video_from_timestamp || 0),};});console.log(`[DEBUG] Created segmented video info:`, videosInfo);return videosInfo;}// Metadata loading for v3.0 episodesasync function loadEpisodeMetadataV3Simple(repoId: string,version: string,episodeId: number,): Promise<any> {console.log(`[DEBUG] Loading v3.0 metadata for episode ${episodeId}`);const episodesMetadataUrl = buildVersionedUrl(repoId,version,"meta/episodes/chunk-000/file-000.parquet");try {const arrayBuffer = await fetchParquetFile(episodesMetadataUrl);const episodesData = await readParquetColumn(arrayBuffer, []);console.log(`[DEBUG] Loaded ${episodesData.length} episode rows`);if (episodesData.length === 0) {throw new Error("No episode metadata found");}// Find the row for the requested episodelet episodeRow = null;for (let i = 0; i < episodesData.length; i++) { // Check all rowsconst row = episodesData[i];const parsedRow = parseEpisodeRowSimple(row, false); // Don't log for each attemptif (parsedRow.episode_index === episodeId) {episodeRow = row;console.log(`[DEBUG] Found episode ${episodeId} at row ${i}`);break;}}if (!episodeRow) {// Fallback: if we can't find the exact episode, use the row at index episodeIdif (episodeId < episodesData.length) {episodeRow = episodesData[episodeId];console.log(`[DEBUG] Using fallback row ${episodeId} for episode ${episodeId}`);} else {throw new Error(`Episode ${episodeId} not found in metadata`);}}// Convert the row to a usable formatreturn parseEpisodeRowSimple(episodeRow, true); // Enable logging for final parse} catch (error) {console.error(`Failed to load episode metadata:`, error);throw error;}}// Simple parser for episode row - focuses on key fields for episodesfunction parseEpisodeRowSimple(row: any, enableLogging: boolean = true): any {if (enableLogging) {console.log(`[DEBUG] Parsing episode row with keys:`, Object.keys(row || {}));console.log(`[DEBUG] Row type:`, typeof row);}// Based on the debug output we saw, the row has numeric string keys// We'll need to map these to meaningful field names// This is a best-guess mapping - may need adjustment based on actual dataif (row && typeof row === 'object') {// Try to extract key fields we need for video segmentation// Based on your example: episode_index, video timestamps, etc.const episodeData = {episode_index: row['0'] || 0, // First column likely episode indexdata_chunk_index: row['1'] || 0, // Data chunk indexdata_file_index: row['2'] || 0, // Data file indexdataset_from_index: row['3'] || 0, // Dataset start indexdataset_to_index: row['4'] || 0, // Dataset end indexvideo_chunk_index: row['5'] || 0, // Video chunk indexvideo_file_index: row['6'] || 0, // Video file indexvideo_from_timestamp: row['7'] || 0, // Video from timestampvideo_to_timestamp: row['8'] || 30, // Video to timestamplength: row['9'] || 30, // Episode length};if (enableLogging) {console.log(`[DEBUG] Raw row values:`);console.log(` Row['0'] (episode_index): ${row['0']}`);console.log(` Row['1'] (data_chunk_index): ${row['1']}`);console.log(` Row['2'] (data_file_index): ${row['2']}`);console.log(` Row['3'] (dataset_from_index): ${row['3']}`);console.log(` Row['4'] (dataset_to_index): ${row['4']}`);console.log(` Row['5'] (video_chunk_index): ${row['5']}`);console.log(` Row['6'] (video_file_index): ${row['6']}`);console.log(` Row['7'] (video_from_timestamp): ${row['7']}`);console.log(` Row['8'] (video_to_timestamp): ${row['8']}`);console.log(` Row['9'] (length): ${row['9']}`);}if (enableLogging) {console.log(`[DEBUG] Parsed episode data:`, episodeData);}return episodeData;}// Fallback if parsing failsconst fallback = {episode_index: 0,data_chunk_index: 0,data_file_index: 0,dataset_from_index: 0,dataset_to_index: 0,video_chunk_index: 0,video_file_index: 0,video_from_timestamp: 0,video_to_timestamp: 30,length: 30,};if (enableLogging) {console.log(`[DEBUG] Using fallback episode data:`, fallback);}return fallback;}// Parse episode metadata row into structured objectfunction parseEpisodeRow(row: any): any {// This is a placeholder - the actual structure depends on how the parquet data is organized// You may need to adjust this based on the actual column names and orderif (Array.isArray(row)) {// If it's an array, we need to map positions to field names// This is a rough mapping - needs to be adjusted based on actual data structurereturn {episode_index: row[0],data_chunk_index: row[1],data_file_index: row[2],dataset_from_index: row[3],dataset_to_index: row[4],video_chunk_index: row[5],video_file_index: row[6],video_from_timestamp: row[7],video_to_timestamp: row[8],length: row[9],// Add more fields as needed};} else {// If it's already an object, return as-isreturn row;}}// Extract video information for v3.0 formatasync function extractVideoInfoV3(repoId: string,version: string,info: DatasetMetadata,episodeMetadata: any,): Promise<any[]> {// Get video features from dataset infoconst videoFeatures = Object.entries(info.features).filter(([key, value]) => value.dtype === "video");const videosInfo = videoFeatures.map(([videoKey, _]) => {// For v3.0, video path format is: videos/camera_key/chunk-000/file-000.mp4// Extract the appropriate chunk and file indices for this video keyconst videoChunkKey = `videos/${videoKey}/chunk_index`;const videoFileKey = `videos/${videoKey}/file_index`;const videoFromTimestampKey = `videos/${videoKey}/from_timestamp`;const videoToTimestampKey = `videos/${videoKey}/to_timestamp`;const chunkIndex = episodeMetadata[videoChunkKey] || 0;const fileIndex = episodeMetadata[videoFileKey] || 0;const fromTimestamp = episodeMetadata[videoFromTimestampKey] || 0;const toTimestamp = episodeMetadata[videoToTimestampKey] || 0;const videoPath = `videos/${videoKey}/chunk-${chunkIndex.toString().padStart(3, "0")}/file-${fileIndex.toString().padStart(3, "0")}.mp4`;return {filename: videoKey,url: buildVersionedUrl(repoId, version, videoPath),// Segment information for v3.0 chunked videosisSegmented: true,segmentStart: fromTimestamp,segmentEnd: toTimestamp,segmentDuration: toTimestamp - fromTimestamp,};});return videosInfo;}// DISABLED: Complex episode data loading for simplified v3.0 implementation/*async function loadEpisodeDataV3(episodeMetadata: any,): Promise<{ chartDataGroups: any[]; ignoredColumns: string[]; duration: number }> {// Complex data loading disabled for simplified implementationthrow new Error("Complex data loading disabled in simplified v3.0 implementation");}*/// Safe wrapper for UI error displayexport async function getEpisodeDataSafe(
6 unmodified lines789101112129 unmodified lines1421431441451461471481491501511521531541551561571581591601611621631641651661671683 unmodified lines1721731741751761771781791801811821831841 unmodified line186187188189190191192193194195196126 unmodified lines3233243253263273286 unmodified linestype VideoInfo = {filename: string;url: string;};type VideoPlayerProps = {129 unmodified lines}}, [hiddenVideos, showHiddenMenu, enlargedVideo]);// Sync video timesuseEffect(() => {videoRefs.current.forEach((video) => {if (video && Math.abs(video.currentTime - currentTime) > 0.2) {video.currentTime = currentTime;}});}, [currentTime]);// Handle time updateconst handleTimeUpdate = (e: React.SyntheticEvent<HTMLVideoElement>) => {const video = e.target as HTMLVideoElement;if (video && video.duration) {setCurrentTime(video.currentTime);}};// Handle video readyuseEffect(() => {let videosReadyCount = 0;const onCanPlayThrough = () => {videosReadyCount += 1;if (videosReadyCount === videosInfo.length) {if (typeof onVideosReady === "function") {3 unmodified lines}};videoRefs.current.forEach((video) => {if (video) {// If already ready, call the handler immediatelyif (video.readyState >= 4) {onCanPlayThrough();} else {video.addEventListener("canplaythrough", onCanPlayThrough);}}});1 unmodified linereturn () => {videoRefs.current.forEach((video) => {if (video) {video.removeEventListener("canplaythrough", onCanPlayThrough);}});};}, []);return (<>126 unmodified lines}}mutedloopclassName={`w-full object-contain ${isEnlarged ? "max-h-[90vh] max-w-[90vw]" : ""}`}onTimeUpdate={idx === firstVisibleIdx ? handleTimeUpdate : undefined6 unmodified lines78910111213141516129 unmodified lines1461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312323 unmodified lines2362372382392402412422432442452462472482492501 unmodified line252253254255256257258259260261262263264265266267268269126 unmodified lines3963973983994004014026 unmodified linestype VideoInfo = {filename: string;url: string;isSegmented?: boolean;segmentStart?: number;segmentEnd?: number;segmentDuration?: number;};type VideoPlayerProps = {129 unmodified lines}}, [hiddenVideos, showHiddenMenu, enlargedVideo]);// Sync video times (with segment awareness)useEffect(() => {videoRefs.current.forEach((video, index) => {if (video && Math.abs(video.currentTime - currentTime) > 0.2) {const videoInfo = videosInfo[index];if (videoInfo?.isSegmented) {// For segmented videos, map the global time to segment timeconst segmentStart = videoInfo.segmentStart || 0;const segmentDuration = videoInfo.segmentDuration || 0;if (segmentDuration > 0) {// Map currentTime (0 to segmentDuration) to video time (segmentStart to segmentEnd)const segmentTime = segmentStart + currentTime;video.currentTime = segmentTime;}} else {// For non-segmented videos, use direct time mappingvideo.currentTime = currentTime;}}});}, [currentTime, videosInfo]);// Handle time updateconst handleTimeUpdate = (e: React.SyntheticEvent<HTMLVideoElement>) => {const video = e.target as HTMLVideoElement;if (video && video.duration) {// Find the video info for this video elementconst videoIndex = videoRefs.current.findIndex(ref => ref === video);const videoInfo = videosInfo[videoIndex];if (videoInfo?.isSegmented) {// For segmented videos, map the video time back to global time (0 to segmentDuration)const segmentStart = videoInfo.segmentStart || 0;const globalTime = Math.max(0, video.currentTime - segmentStart);setCurrentTime(globalTime);} else {// For non-segmented videos, use direct time mappingsetCurrentTime(video.currentTime);}}};// Handle video ready and setup segmentationuseEffect(() => {let videosReadyCount = 0;const onCanPlayThrough = (videoIndex: number) => {const video = videoRefs.current[videoIndex];const videoInfo = videosInfo[videoIndex];// Setup video segmentation for v3.0 chunked videosif (video && videoInfo?.isSegmented) {const segmentStart = videoInfo.segmentStart || 0;const segmentEnd = videoInfo.segmentEnd || video.duration || 0;console.log(`[VIDEO DEBUG] Setting up segmentation for ${videoInfo.filename}: ${segmentStart}s to ${segmentEnd}s`);// Set initial time to segment start if not already setif (video.currentTime < segmentStart || video.currentTime > segmentEnd) {video.currentTime = segmentStart;}// Add event listener to handle segment boundariesconst handleTimeUpdate = () => {if (video.currentTime > segmentEnd) {video.currentTime = segmentStart;if (!video.loop) {video.pause();}}};video.addEventListener('timeupdate', handleTimeUpdate);// Store cleanup function(video as any)._segmentCleanup = () => {video.removeEventListener('timeupdate', handleTimeUpdate);};}videosReadyCount += 1;if (videosReadyCount === videosInfo.length) {if (typeof onVideosReady === "function") {3 unmodified lines}};videoRefs.current.forEach((video, index) => {if (video) {// If already ready, call the handler immediatelyif (video.readyState >= 4) {onCanPlayThrough(index);} else {const readyHandler = () => onCanPlayThrough(index);video.addEventListener("canplaythrough", readyHandler);(video as any)._readyHandler = readyHandler;}}});1 unmodified linereturn () => {videoRefs.current.forEach((video) => {if (video) {// Remove ready handlerif ((video as any)._readyHandler) {video.removeEventListener("canplaythrough", (video as any)._readyHandler);}// Remove segment handlerif ((video as any)._segmentCleanup) {(video as any)._segmentCleanup();}}});};}, [videosInfo, onVideosReady, setIsPlaying]);return (<>126 unmodified lines}}mutedlooppreload="auto"className={`w-full object-contain ${isEnlarged ? "max-h-[90vh] max-w-[90vw]" : ""}`}onTimeUpdate={idx === firstVisibleIdx ? handleTimeUpdate : undefined
51 unmodified lines525354555657585960616251 unmodified linesfileBuffer: ArrayBuffer,columns: string[],): Promise<any[]> {return new Promise((resolve) => {parquetRead({file: fileBuffer,columns,onComplete: (data: any[]) => resolve(data),});});}51 unmodified lines52535455565758596061626364656667686970717251 unmodified linesfileBuffer: ArrayBuffer,columns: string[],): Promise<any[]> {return new Promise((resolve, reject) => {parquetRead({file: fileBuffer,columns: columns.length > 0 ? columns : undefined, // Let hyparquet read all columns if empty arrayonComplete: (data: any[]) => {console.log('[DEBUG] Parquet read completed, data length:', data.length);if (data.length > 0) {console.log('[DEBUG] First data row structure:', typeof data[0], Object.keys(data[0] || {}));}resolve(data);},onError: (error: any) => {console.error('[DEBUG] Parquet read error:', error);reject(error);}});});}
40 unmodified lines41424344454647484950515253545556575859606162636465666740 unmodified lines}}/*** Determines the best available version for a dataset.* Prefers v3.0, falls back to v2.1, then v2.0, or throws an error if none exist.*/export async function getDatasetVersion(repoId: string): Promise<string> {// Check for v3.0 firstif (await checkVersionExists(repoId, "v3.0")) {return "v3.0";}// Check for v2.1if (await checkVersionExists(repoId, "v2.1")) {return "v2.1";}// Fall back to v2.0if (await checkVersionExists(repoId, "v2.0")) {return "v2.0";}// If none of the supported versions exist, throw an errorthrow new Error(`Dataset ${repoId} is not compatible with this visualizer. ` +"This tool only works with dataset versions 3.0, 2.1, or 2.0. " +40 unmodified lines414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810940 unmodified lines}}/*** Checks if a dataset has v3.0 chunked structure*/async function checkV3ChunkedStructure(repoId: string): Promise<boolean> {try {const testUrl = `${DATASET_URL}/${repoId}/resolve/v3.0/meta/episodes/chunk-000/file-000.parquet`;const controller = new AbortController();const timeoutId = setTimeout(() => controller.abort(), 10000);const response = await fetch(testUrl, {method: "HEAD",cache: "no-store",signal: controller.signal});clearTimeout(timeoutId);return response.ok;} catch (error) {return false;}}/*** Determines the best available version for a dataset.* Prefers v3.0, falls back to v2.1, then v2.0, or throws an error if none exist.*/export async function getDatasetVersion(repoId: string): Promise<string> {console.log(`[VERSION DEBUG] Checking versions for ${repoId}`);// Check for v3.0 first - must have both info.json AND chunked episode structureconst hasV3Info = await checkVersionExists(repoId, "v3.0");console.log(`[VERSION DEBUG] v3.0 info.json exists: ${hasV3Info}`);if (hasV3Info) {const hasV3Structure = await checkV3ChunkedStructure(repoId);console.log(`[VERSION DEBUG] v3.0 chunked structure exists: ${hasV3Structure}`);if (hasV3Structure) {console.log(`[VERSION DEBUG] Using v3.0 for ${repoId}`);return "v3.0";}}// Check for v2.1const hasV21 = await checkVersionExists(repoId, "v2.1");console.log(`[VERSION DEBUG] v2.1 exists: ${hasV21}`);if (hasV21) {console.log(`[VERSION DEBUG] Using v2.1 for ${repoId}`);return "v2.1";}// Fall back to v2.0const hasV20 = await checkVersionExists(repoId, "v2.0");console.log(`[VERSION DEBUG] v2.0 exists: ${hasV20}`);if (hasV20) {console.log(`[VERSION DEBUG] Using v2.0 for ${repoId}`);return "v2.0";}// If none of the supported versions exist, throw an errorconsole.log(`[VERSION DEBUG] No compatible versions found for ${repoId}`);throw new Error(`Dataset ${repoId} is not compatible with this visualizer. ` +"This tool only works with dataset versions 3.0, 2.1, or 2.0. " +
src/app/[org]/[dataset]/[episode]/episode-viewer.tsx-8
src/app/[org]/[dataset]/[episode]/fetch-data.ts+880-192
src/components/videos-player.tsx+86-12
src/utils/parquetUtils.ts+13-3
src/utils/versionUtils.ts+47-5