Repository navigation
Add FAQ documentation for common workflows #1691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
shuchi270
wants to merge
1
commit into
apache:main
Choose a base branch
from
shuchi270:docs/faq
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| <!-- | ||
| Licensed to the Apache Software Foundation (ASF) under one | ||
| or more contributor license agreements. See the NOTICE file | ||
| distributed with this work for additional information | ||
| regarding copyright ownership. The ASF licenses this file | ||
| to you under the Apache License, Version 2.0 (the | ||
| "License"); you may not use this file except in compliance | ||
| with the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, | ||
| software distributed under the License is distributed on an | ||
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| KIND, either express or implied. See the License for the | ||
| specific language governing permissions and limitations | ||
| under the License. | ||
| --> | ||
|
|
||
| # Frequently Asked Questions | ||
|
|
||
| This page collects common starting points for Apache Hamilton users. Each answer is intentionally brief; follow the links for the detailed concepts and examples. | ||
|
|
||
| ## How do I cache a workflow and restart it later? | ||
|
|
||
| **TL;DR:** Enable caching with `Builder().with_cache()` so Hamilton stores node results and reuses unchanged work in later executions. Because cache keys include node code and dependency data versions, you can stop and restart a workflow or move investigation to another environment without recomputing compatible results. | ||
|
|
||
| Read next: | ||
|
|
||
| - [Caching concept](concepts/caching.rst) | ||
| - [Caching tutorial](how-tos/caching-tutorial.ipynb) | ||
| - [Caching reference](reference/caching/caching-logic.rst) | ||
|
|
||
| ## How do I filter or join data with Series? | ||
|
|
||
| **TL;DR:** Keep filtering, joining, and other dataframe or Series operations inside ordinary typed Hamilton functions, using the API of the dataframe library you return and accept. For reusable feature transformations, model intermediate Series or columns as nodes and use `@extract_columns` when column-level lineage or reuse is useful. | ||
|
|
||
| Read next: | ||
|
|
||
| - [Feature engineering with Apache Hamilton](how-tos/use-for-feature-engineering.rst) | ||
| - [Function modifiers](concepts/function-modifiers.rst) | ||
| - [Ibis integration for table filters and joins](integrations/ibis/index.md) | ||
| - [Extract columns reference](reference/decorators/extract_columns.rst) | ||
|
|
||
| ## How do I handle Spark DataFrames? | ||
|
|
||
| **TL;DR:** Treat a Spark DataFrame as the input or output of typed Hamilton functions and keep Spark transformations in those functions, just as you would with pandas or another dataframe library. For distributed execution, use the Spark examples and choose the Spark graph adapter or decorators that match whether you are composing Spark transformations or generating PySpark UDFs. | ||
|
|
||
| Read next: | ||
|
|
||
| - [Spark examples](https://github.com/apache/hamilton/tree/main/examples/spark) | ||
| - [Spark graph adapters](reference/graph-adapters/index.rst) | ||
| - [`with_columns` Spark reference](reference/decorators/with_columns.rst) | ||
| - [Scaling computation](how-tos/scale-up.rst) | ||
|
|
||
| ## How can I scale up? | ||
|
|
||
| **TL;DR:** Separate transformation logic from execution, then scale the appropriate dimension: use Ray or Dask for parallelizing transformations, or Spark and pandas-on-Spark for larger distributed datasets. Start with the scaling guide and the corresponding integration example, then select the execution adapter that fits your workload and deployment environment. | ||
|
|
||
| Read next: | ||
|
|
||
| - [Scaling computation](how-tos/scale-up.rst) | ||
| - [Parallel task execution](concepts/parallel-task.rst) | ||
| - [Graph adapters reference](reference/graph-adapters/index.rst) | ||
| - [Integrations](integrations/index.rst) | ||
|
|
||
| ## How do I configure my pipeline? | ||
|
|
||
| **TL;DR:** Build a `Driver` with `Builder()` and configure modules, runtime configuration, materializers, caching, lifecycle hooks, and execution adapters before calling `.build()`. Use `with_config()` with `@config` decorators when configuration should select which functions become nodes, and rebuild the Driver when those configuration values change. | ||
|
|
||
| Read next: | ||
|
|
||
| - [Builder configuration](concepts/builder.rst) | ||
| - [Driver concept](concepts/driver.rst) | ||
| - [Function modifiers](concepts/function-modifiers.rst) | ||
| - [Materialization](concepts/materialization.rst) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AI-generated review comment:
with_cache()defaults to stores under the current environment's./.hamilton_cache, so enabling it alone does not let a user move to another environment and reuse results. The cache must first be copied or shared, and compatibility matters: Python or Hamilton version changes can invalidate keys, while changing the hashing backend changes every data version. Could we make those prerequisites explicit? For example: “You can stop and restart a workflow using the same cache; to reuse it from another environment, that environment must have access to the cache and use compatible Python, Hamilton, dependency, and hashing-backend versions.”