Skip to content

Commit

Permalink
Refactor: Streamline Verb Core Functions, Package Exports (microsoft#747
Browse files Browse the repository at this point in the history
)
  • Loading branch information
darthtrevino authored Jun 20, 2024
1 parent e72bc35 commit d101fcd
Show file tree
Hide file tree
Showing 154 changed files with 2,793 additions and 2,623 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"type": "major",
"type": "patch",
"description": "schema changes"
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"type": "major",
"type": "patch",
"description": "Schema cleanup"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "patch",
"description": "split verbs from execution-graph boilerplate"
}
218 changes: 87 additions & 131 deletions python/datashaper/datashaper/__init__.py
Original file line number Diff line number Diff line change
@@ -1,98 +1,70 @@
"""DataShaper is a library for declarative data manipulation and transformation."""
from .engine import (
AsyncType,

from .tables import (
DataTable,
DiskCacheTableStore,
InMemoryTableStore,
ParserOptions,
TableStore,
TypeHints,
load_csv_table,
load_json_table,
load_table,
)
from .utils.parallelization import AsyncStrategy, derive_from_rows
from .utils.progress import (
Progress,
ProgressHandler,
ProgressTicker,
progress_callback,
progress_iterable,
progress_ticker,
)
from .verbs import (
Bin,
BinStrategy,
BooleanComparisonOperator,
BooleanLogicalOperator,
Category,
ColumnMetadata,
ColumnStats,
ComparisonStrategy,
DataType,
FieldAggregateOperation,
FileType,
FileFormat,
FilterArgs,
InputColumnArgs,
JoinStrategy,
MathOperator,
MergeStrategy,
NoopVerbCallbacks,
NumericComparisonOperator,
OrderByInstruction,
ParallelizationMode,
ParseType,
SetOp,
SortDirection,
Step,
StringComparisonOperator,
Table,
TableContainer,
TableMetadata,
VerbCallbacks,
VerbDetails,
VerbInput,
VerbManager,
VerbResult,
WindowFunction,
aggregate_operation_mapping,
boolean_function_map,
filter_df,
get_operator,
inputs,
load_verbs,
new_row,
parallel_verb,
verb,
)
from .errors import (
InvalidVerbInputError,
NodeNotVisitedError,
NoVerbInputsProvidedError,
UnsupportedComparisonOperatorError,
VerbAlreadyRegisteredError,
VerbError,
VerbHasMultipleDefaultInputsError,
VerbHasMultipleDefaultOthersError,
VerbOperationNotSupportedError,
VerbParallelizationError,
WorkflowError,
WorkflowInvalidInputError,
WorkflowMissingInputError,
WorkflowOutputNotReadyError,
WorkflowVerbNotFoundError,
)
from .execution import (
ExecutionNode,
VerbDefinitions,
derive_from_rows,
derive_from_rows_asyncio,
derive_from_rows_asyncio_threads,
parallelize,
)
from .progress import (
Progress,
ProgressHandler,
ProgressTicker,
progress_callback,
progress_iterable,
progress_ticker,
)
from .table_store.types import (
ColumnMetadata,
ColumnStats,
Table,
TableContainer,
TableMetadata,
VerbResult,
create_verb_result,
)
from .tables import (
DataTable,
ParserOptions,
TypeHints,
load_csv_table,
load_json_table,
load_table,
)
from .workflow import (
DEFAULT_INPUT_NAME,
DelegatingVerbCallbacks,
ExecutionNode,
MemoryProfile,
NoopVerbCallbacks,
NoopWorkflowCallbacks,
PandasDtypeBackend,
VerbCallbacks,
VerbTiming,
Workflow,
WorkflowCallbacks,
Expand All @@ -101,34 +73,67 @@
)

__all__ = [
"AsyncType",
"derive_from_rows",
"derive_from_rows_asyncio",
"derive_from_rows_asyncio_threads",
"parallelize",
"VerbDefinitions",
# Workflow Exports
"Workflow",
"DEFAULT_INPUT_NAME",
"WorkflowRunResult",
"VerbTiming",
"MemoryProfile",
"WorkflowCallbacks",
"NoopWorkflowCallbacks",
"WorkflowCallbacksManager",
"PandasDtypeBackend",
"ExecutionNode",
# Verb Exports
# table utilities
"DataTable",
"ParserOptions",
"TypeHints",
"load_csv_table",
"load_json_table",
"load_table",
"DiskCacheTableStore",
"InMemoryTableStore",
"TableStore",
# Progress Utils
"progress_callback",
"progress_iterable",
"progress_ticker",
"ProgressHandler",
"ProgressTicker",
"Progress",
# Parallelization Utils
"derive_from_rows",
"AsyncStrategy",
# Verb Types
"Table",
"TableContainer",
"TableMetadata",
"ColumnMetadata",
"ColumnStats",
"DataType",
"Bin",
"Category",
"VerbInput",
"VerbDetails",
"verb",
"VerbManager",
"load_verbs",
"verb",
"inputs",
"parallel_verb",
"new_row",
# Verb Parameters
"BinStrategy",
"ParallelizationMode",
"VerbDetails",
"VerbResult",
"Bin",
"BinStrategy",
"BooleanComparisonOperator",
"BooleanLogicalOperator",
"Category",
"ComparisonStrategy",
"DataType",
"FieldAggregateOperation",
"FileType",
"FileFormat",
"FilterArgs",
"ComparisonStrategy",
"InputColumnArgs",
"JoinStrategy",
"DataType",
"MathOperator",
"MergeStrategy",
"NumericComparisonOperator",
Expand All @@ -138,60 +143,11 @@
"SortDirection",
"StringComparisonOperator",
"WindowFunction",
"Step",
"aggregate_operation_mapping",
"boolean_function_map",
"filter_df",
"get_operator",
# Workflow Exports
"Workflow",
"DEFAULT_INPUT_NAME",
"WorkflowRunResult",
"VerbTiming",
"MemoryProfile",
"VerbCallbacks",
"DelegatingVerbCallbacks",
"NoopVerbCallbacks",
"WorkflowCallbacks",
"NoopWorkflowCallbacks",
"WorkflowCallbacksManager",
"PandasDtypeBackend",
# Tablestore Exports
"ColumnStats",
"Table",
"ColumnMetadata",
"TableMetadata",
"ColumnStats",
"TableContainer",
"Table",
"VerbResult",
"create_verb_result",
# table utilities
"DataTable",
"ParserOptions",
"TypeHints",
"load_csv_table",
"load_json_table",
"load_table",
# Progress Exports
"progress_callback",
"progress_iterable",
"progress_ticker",
"ProgressHandler",
"ProgressTicker",
"Progress",
# Errors
"UnsupportedComparisonOperatorError",
"InvalidVerbInputError",
"VerbError",
"WorkflowMissingInputError",
"WorkflowOutputNotReadyError",
"WorkflowVerbNotFoundError",
"VerbAlreadyRegisteredError",
"VerbParallelizationError",
"WorkflowError",
"NoVerbInputsProvidedError",
"VerbHasMultipleDefaultInputsError",
"VerbHasMultipleDefaultOthersError",
"VerbOperationNotSupportedError",
"NodeNotVisitedError",
"WorkflowInvalidInputError",
"TableMetadata",
"NoopVerbCallbacks",
"VerbCallbacks",
]
8 changes: 8 additions & 0 deletions python/datashaper/datashaper/constants.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project.
#
"""Datashaper constants."""

DEFAULT_INPUT_NAME = "source"
DEFAULT_OUTPUT_NAME = "result"
78 changes: 0 additions & 78 deletions python/datashaper/datashaper/engine/__init__.py

This file was deleted.

10 changes: 0 additions & 10 deletions python/datashaper/datashaper/engine/pandas/__init__.py

This file was deleted.

Loading

0 comments on commit d101fcd

Please sign in to comment.