Skip to content

Commit

Permalink
it's now OK to load the root batch without an ix tile I think
Browse files Browse the repository at this point in the history
  • Loading branch information
bmschmidt committed May 17, 2024
1 parent 9e7106b commit 65d2e3c
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/tile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -518,21 +518,12 @@ export class Tile {

const manifest: Partial<TileManifest> = {};
this._deriveManifestFromTileMetadata = this.get_arrow(null).then(
(batch) => {
if (this._batch) {
if (!this._batch.getChild('ix')) {
throw new Error("Can't overwrite _batch safely");
} else {
// pass, there isn't anything to do.
}
} else {
this._batch = batch;
}
async (batch) => {
// For every column in the root tile,
// define a transformation for other children that says
// 'load the main batch and pull out this column'.
const { deeptable } = this;

// Ensure there are transformations for the columns in the root tile.
for (const field of batch.schema.fields) {
if (!deeptable.transformations[field.name]) {
deeptable.transformations[field.name] = async (tile: Tile) => {
Expand Down Expand Up @@ -562,7 +553,7 @@ export class Tile {
}

// TODO: make ix optionally parsed from metadata, not column.
const ixes = batch.getChild('ix');
const ixes = await this.get_column('ix');

if (ixes === null) {
throw 'No ix column in table';
Expand Down Expand Up @@ -675,7 +666,8 @@ export function p_in_rect(p: Point, rect: Rectangle | undefined) {

/**
* Returns the coordinates of a 'macrotile' for any given tile.
* This is an experimental feature that is not part of the public API.
* This is an experimental feature that should not be relied on as
* part of the public API.
* @deprecated
*
* @param key The key to get the macrotile of
Expand Down

0 comments on commit 65d2e3c

Please sign in to comment.