[
https://issues.apache.org/jira/browse/ARROW-2219?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16377453#comment-16377453
]
ASF GitHub Bot commented on ARROW-2219:
---------------------------------------
TheNeuralBit closed pull request #1666: ARROW-2219: [JS] rename indicies to
indices
URL: https://github.com/apache/arrow/pull/1666
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/js/src/Arrow.externs.js b/js/src/Arrow.externs.js
index de1e65392..cf4db9134 100644
--- a/js/src/Arrow.externs.js
+++ b/js/src/Arrow.externs.js
@@ -447,7 +447,7 @@ FlatListData.prototype.valueOffsets;
var DictionaryData = function() {};
/** @type {?} */
-DictionaryData.prototype.indicies;
+DictionaryData.prototype.indices;
/** @type {?} */
DictionaryData.prototype.dictionary;
diff --git a/js/src/data.ts b/js/src/data.ts
index d49fb790b..cdd9f29a7 100644
--- a/js/src/data.ts
+++ b/js/src/data.ts
@@ -148,28 +148,28 @@ export class FlatListData<T extends FlatListType> extends
FlatData<T> {
export class DictionaryData<T extends DataType> extends
BaseData<Dictionary<T>> {
protected _dictionary: Vector<T>;
- protected _indicies: Data<Int<any>>;
- public get indicies() { return this._indicies; }
+ protected _indices: Data<Int<any>>;
+ public get indices() { return this._indices; }
public get dictionary() { return this._dictionary; }
- constructor(type: Dictionary<T>, dictionary: Vector<T>, indicies:
Data<Int<any>>) {
- super(type, indicies.length, (indicies as any)._nullCount);
- this._indicies = indicies;
+ constructor(type: Dictionary<T>, dictionary: Vector<T>, indices:
Data<Int<any>>) {
+ super(type, indices.length, (indices as any)._nullCount);
+ this._indices = indices;
this._dictionary = dictionary;
- this.length = this._indicies.length;
+ this.length = this._indices.length;
}
- public get nullCount() { return this._indicies.nullCount; }
- public get nullBitmap() { return this._indicies.nullBitmap; }
+ public get nullCount() { return this._indices.nullCount; }
+ public get nullBitmap() { return this._indices.nullBitmap; }
public clone<R extends Dictionary<T>>(type: R, length = this.length,
offset = this.offset) {
const data = this._dictionary.data.clone(type.dictionary as any);
return new DictionaryData<R>(
this.type as any,
this._dictionary.clone(data) as any,
- this._indicies.slice(offset - this.offset, length)
+ this._indices.slice(offset - this.offset, length)
) as any;
}
protected sliceInternal(clone: this, _offset: number, _length: number) {
- clone.length = clone._indicies.length;
- clone._nullCount = (clone._indicies as any)._nullCount;
+ clone.length = clone._indices.length;
+ clone._nullCount = (clone._indices as any)._nullCount;
return clone;
}
}
diff --git a/js/src/ipc/reader/vector.ts b/js/src/ipc/reader/vector.ts
index 809069c6d..b8c4871eb 100644
--- a/js/src/ipc/reader/vector.ts
+++ b/js/src/ipc/reader/vector.ts
@@ -92,7 +92,7 @@ export abstract class TypeDataLoader extends TypeVisitor {
public visitFixedSizeList (type: FixedSizeList) { return
this.visitFixedSizeListType(type); }
public visitMap (type: Map_) { return
this.visitNestedType(type); }
public visitDictionary (type: Dictionary) {
- return new DictionaryData(type, this.dictionaries.get(type.id)!,
this.visit(type.indicies));
+ return new DictionaryData(type, this.dictionaries.get(type.id)!,
this.visit(type.indices));
}
protected getFieldMetadata() { return this.nodes.next().value; }
protected getBufferMetadata() { return this.buffers.next().value; }
diff --git a/js/src/table.ts b/js/src/table.ts
index 3e50d16e3..d0d699f36 100644
--- a/js/src/table.ts
+++ b/js/src/table.ts
@@ -160,7 +160,7 @@ export class Table implements DataFrame {
const batch = batches[batchIndex];
// rebind the countBy Col
count_by.bind(batch);
- const keys = (count_by.vector as DictionaryVector).indicies;
+ const keys = (count_by.vector as DictionaryVector).indices;
// yield all indices
for (let index = -1, numRows = batch.length; ++index < numRows;) {
let key = keys.get(index);
@@ -258,7 +258,7 @@ class FilteredDataFrame implements DataFrame {
const predicate = this.predicate.bind(batch);
// rebind the countBy Col
count_by.bind(batch);
- const keys = (count_by.vector as DictionaryVector).indicies;
+ const keys = (count_by.vector as DictionaryVector).indices;
// yield all indices
for (let index = -1, numRows = batch.length; ++index < numRows;) {
let key = keys.get(index);
diff --git a/js/src/type.ts b/js/src/type.ts
index 5e6c939ef..370be0def 100644
--- a/js/src/type.ts
+++ b/js/src/type.ts
@@ -83,8 +83,8 @@ export class Field<T extends DataType = DataType> {
public toString() { return `${this.name}: ${this.type}`; }
public get typeId(): T['TType'] { return this.type.TType; }
public get [Symbol.toStringTag](): string { return 'Field'; }
- public get indicies(): T | Int<any> {
- return DataType.isDictionary(this.type) ? this.type.indicies :
this.type;
+ public get indices(): T | Int<any> {
+ return DataType.isDictionary(this.type) ? this.type.indices :
this.type;
}
}
@@ -443,17 +443,17 @@ export interface Dictionary<T extends DataType = any>
extends DataType<Type.Dict
export class Dictionary<T extends DataType> extends DataType<Type.Dictionary> {
public readonly id: number;
public readonly dictionary: T;
- public readonly indicies: Int<any>;
+ public readonly indices: Int<any>;
public readonly isOrdered: boolean;
- constructor(dictionary: T, indicies: Int<any>, id?: Long | number | null,
isOrdered?: boolean | null) {
+ constructor(dictionary: T, indices: Int<any>, id?: Long | number | null,
isOrdered?: boolean | null) {
super(Type.Dictionary);
- this.indicies = indicies;
+ this.indices = indices;
this.dictionary = dictionary;
this.isOrdered = isOrdered || false;
this.id = id == null ? DictionaryBatch.getId() : typeof id ===
'number' ? id : id.low;
}
public get ArrayType() { return this.dictionary.ArrayType; }
- public toString() { return `Dictionary<${this.indicies},
${this.dictionary}>`; }
+ public toString() { return `Dictionary<${this.indices},
${this.dictionary}>`; }
protected static [Symbol.toStringTag] = ((proto: Dictionary) => {
return proto[Symbol.toStringTag] = 'Dictionary';
})(Dictionary.prototype);
diff --git a/js/src/vector.ts b/js/src/vector.ts
index fa1d16efc..f36c691e1 100644
--- a/js/src/vector.ts
+++ b/js/src/vector.ts
@@ -394,29 +394,29 @@ export class UnionVector<T extends (SparseUnion |
DenseUnion) = any> extends Nes
export class DictionaryVector<T extends DataType = DataType> extends
Vector<Dictionary<T>> {
// @ts-ignore
- public readonly indicies: Vector<Int>;
+ public readonly indices: Vector<Int>;
// @ts-ignore
public readonly dictionary: Vector<T>;
- constructor(data: Data<Dictionary<T>>, view: View<Dictionary<T>> = new
DictionaryView<T>(data.dictionary, new IntVector(data.indicies))) {
+ constructor(data: Data<Dictionary<T>>, view: View<Dictionary<T>> = new
DictionaryView<T>(data.dictionary, new IntVector(data.indices))) {
super(data as Data<any>, view);
if (data instanceof DictionaryData && view instanceof DictionaryView) {
- this.indicies = view.indicies;
+ this.indices = view.indices;
this.dictionary = data.dictionary;
} else if (data instanceof ChunkedData && view instanceof ChunkedView)
{
const chunks = view.chunkVectors as DictionaryVector<T>[];
// Assume the last chunk's dictionary data is the most up-to-date,
// including data from DictionaryBatches that were marked as deltas
this.dictionary = chunks[chunks.length - 1].dictionary;
- this.indicies = chunks.reduce<Vector<Int> | null>(
+ this.indices = chunks.reduce<Vector<Int> | null>(
(idxs: Vector<Int> | null, dict: DictionaryVector<T>) =>
- !idxs ? dict.indicies! : idxs.concat(dict.indicies!),
+ !idxs ? dict.indices! : idxs.concat(dict.indices!),
null
)!;
} else {
throw new TypeError(`Unrecognized DictionaryVector view`);
}
}
- public getKey(index: number) { return this.indicies.get(index); }
+ public getKey(index: number) { return this.indices.get(index); }
public getValue(key: number) { return this.dictionary.get(key); }
public reverseLookup(value: T) { return this.dictionary.indexOf(value); }
}
diff --git a/js/src/vector/dictionary.ts b/js/src/vector/dictionary.ts
index f4de810b0..21f9bac09 100644
--- a/js/src/vector/dictionary.ts
+++ b/js/src/vector/dictionary.ts
@@ -20,31 +20,31 @@ import { View, Vector } from '../vector';
import { IterableArrayLike, DataType, Dictionary, Int } from '../type';
export class DictionaryView<T extends DataType> implements View<T> {
- public indicies: Vector<Int>;
+ public indices: Vector<Int>;
public dictionary: Vector<T>;
- constructor(dictionary: Vector<T>, indicies: Vector<Int>) {
- this.indicies = indicies;
+ constructor(dictionary: Vector<T>, indices: Vector<Int>) {
+ this.indices = indices;
this.dictionary = dictionary;
}
public clone(data: Data<Dictionary<T>>): this {
- return new DictionaryView(data.dictionary,
this.indicies.clone(data.indicies)) as this;
+ return new DictionaryView(data.dictionary,
this.indices.clone(data.indices)) as this;
}
public isValid(index: number): boolean {
- return this.indicies.isValid(index);
+ return this.indices.isValid(index);
}
public get(index: number): T['TValue'] {
- return this.dictionary.get(this.indicies.get(index));
+ return this.dictionary.get(this.indices.get(index));
}
public set(index: number, value: T['TValue']): void {
- this.dictionary.set(this.indicies.get(index), value);
+ this.dictionary.set(this.indices.get(index), value);
}
public toArray(): IterableArrayLike<T['TValue']> {
return [...this];
}
public *[Symbol.iterator](): IterableIterator<T['TValue']> {
- const values = this.dictionary, indicies = this.indicies;
- for (let index = -1, n = indicies.length; ++index < n;) {
- yield values.get(indicies.get(index));
+ const values = this.dictionary, indices = this.indices;
+ for (let index = -1, n = indices.length; ++index < n;) {
+ yield values.get(indices.get(index));
}
}
public indexOf(search: T['TValue']) {
@@ -52,7 +52,7 @@ export class DictionaryView<T extends DataType> implements
View<T> {
const key = this.dictionary.indexOf(search);
if (key === -1) { return key; }
- // ... then find the first occurence of that key in indicies
- return this.indicies.indexOf(key!);
+ // ... then find the first occurence of that key in indices
+ return this.indices.indexOf(key!);
}
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [JS] Fix "indices" typo
> ------------------------
>
> Key: ARROW-2219
> URL: https://issues.apache.org/jira/browse/ARROW-2219
> Project: Apache Arrow
> Issue Type: Bug
> Components: JavaScript
> Reporter: Wes McKinney
> Assignee: Paul Taylor
> Priority: Major
> Labels: pull-request-available
> Fix For: JS-0.4.0
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)