internal

package
v0.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ApiServerEnvVarKey = "CHALK_API_SERVER"
View Source
const ClientIdEnvVarKey = "CHALK_CLIENT_ID"
View Source
const ClientSecretEnvVarKey = "CHALK_CLIENT_SECRET"
View Source
const EnvironmentEnvVarKey = "CHALK_ACTIVE_ENVIRONMENT"

Variables

View Source
var NameTag = "name"

Functions

func ChalkMarshal added in v0.3.13

func ChalkMarshal(attrs map[string]any) ([]byte, error)

ChalkMarshal converts a map to a byte array. Follows the byte-packing format as described in the Chalk Python repo's `byte_transmit.serialize()` function.

func ChalkUnmarshal added in v0.3.6

func ChalkUnmarshal(body []byte) (map[string]any, error)

func ChalkpySnakeCase added in v0.8.2

func ChalkpySnakeCase(s string) string

ChalkpySnakeCase aims to be in parity with our Python implementation of snake_case

func ColumnMapToRecord added in v0.7.0

func ColumnMapToRecord(inputs map[string]any) (arrow.Record, error)

ColumnMapToRecord converts a map of column names to slices of values to an Arrow Record.

func ConvertBytesToTable added in v0.3.7

func ConvertBytesToTable(byteArr []byte) (result arrow.Table, err error)

func CreateOnlineQueryBulkBody added in v0.3.6

func CreateOnlineQueryBulkBody(inputs map[string]any, header FeatherRequestHeader) ([]byte, error)

func CreateUploadFeaturesBody added in v0.3.13

func CreateUploadFeaturesBody(inputs map[string]any) ([]byte, error)

func ExpandTilde added in v0.3.3

func ExpandTilde(path string) (string, error)

func ExtractFeaturesFromTable added in v0.7.0

func ExtractFeaturesFromTable(table arrow.Table) ([]map[string]any, error)

func FileExists

func FileExists(path string) bool

func FormatBucketDuration

func FormatBucketDuration(duration int) string

FormatBucketDuration takes an integer number of seconds and returns a string representation that satisfies these conditions:

  • the largest possible unit of time (e.g. "10m" instead of "600s")
  • a single unit of time (e.g. "601s" instead of "10m1s")

func GenerateGetEnumFunction

func GenerateGetEnumFunction[K comparable](valueToEnum map[string]K, enumName string) func(string) (*K, error)

func GetHeaderFromSerializedOnlineQueryBulkBody added in v0.5.1

func GetHeaderFromSerializedOnlineQueryBulkBody(body []byte) (map[string]any, error)

func GetReflectValue added in v0.3.6

func GetReflectValue(value any, typ reflect.Type) (*reflect.Value, error)

GetReflectValue returns a reflect.Value of the given type from the given non-reflect value.

func GetValueFromArrowArray added in v0.7.0

func GetValueFromArrowArray(a arrow.Array, idx int) (any, error)

func IsDataclass added in v0.3.6

func IsDataclass(field reflect.Value) bool

func KindMismatchError added in v0.8.4

func KindMismatchError(expected reflect.Kind, actual reflect.Kind) error

func ParseBucketDuration

func ParseBucketDuration(durationStr string) (int, error)

ParseBucketDuration parses a bucket duration string and returns the duration in seconds. The input string must be of the form "Nunit" where N is a positive integer and unit is one of "s", "m", "h", "d", or "w".

func Ptr added in v0.8.4

func Ptr[T any](value T) *T

func ReflectPtr added in v0.8.4

func ReflectPtr(value reflect.Value) reflect.Value

func SliceAppend added in v0.7.0

func SliceAppend(slicePtr any, value reflect.Value)

func StringOrNil

func StringOrNil(value string) *string

Types

type BufferWriteSeeker added in v0.3.7

type BufferWriteSeeker struct {
	// contains filtered or unexported fields
}

func (*BufferWriteSeeker) Bytes added in v0.3.7

func (b *BufferWriteSeeker) Bytes() []byte

func (*BufferWriteSeeker) Seek added in v0.3.7

func (b *BufferWriteSeeker) Seek(offset int64, whence int) (int64, error)

func (*BufferWriteSeeker) Write added in v0.3.7

func (b *BufferWriteSeeker) Write(p []byte) (n int, err error)

type FeatherRequestHeader added in v0.4.7

type FeatherRequestHeader struct {
	Outputs  []string `json:"outputs"`
	BranchId *string  `json:"branch_id"`
	Explain  bool     `json:"explain"`
}

type Numbers added in v0.3.6

type Numbers interface {
	int | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | float32 | float64
}

Directories

Path Synopsis
tests

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL