Skip to content
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

Support param tables with only index and no columns #106

Merged
merged 2 commits into from
Jan 23, 2024
Merged

Conversation

SimonHeybrock
Copy link
Member

Fixes #58.

Also fixes #105. We support replacing tables, but each table is treated atomically, i.e., we do not support replacing a column in an existing table when adding another table.

@SimonHeybrock SimonHeybrock requested a review from nvaytet January 22, 2024 08:18
existing == params.row_dim
and param_name in self._param_tables[existing]
):
# Column will be removed by del_param_table below, clash is ok
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you ever be in a situation where an error is raised in the loop and you never get to the del_param_table, and somehow end up with a corrupt pipeline that you cannot use?

I guess the risk is minimal and you would just re-build the pipeline from scratch instead of trying to fix it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand your question. This check is moved here (from below) precisely to avoid corruption, i.e., before any modification?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check is moved here (from below)

Where was it moved from exactly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if params.row_dim in self._param_tables: that used to be above is now below these lines.


pl = sl.Pipeline((to_str,))
pl.set_param_series(int, ints)
assert pl.compute(sl.Series[int, str]) == sl.Series(int, {1: '1', 2: '2', 3: '3'})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a test to check if someone is trying to use set_param_series on a pipeline that already has a param_table with different columns? Or maybe that is just handled by the fact that set_param_series is calling set_param_table internally?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that is handled.

@SimonHeybrock SimonHeybrock merged commit 3c48a37 into main Jan 23, 2024
5 checks passed
@SimonHeybrock SimonHeybrock deleted the param-series branch January 23, 2024 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replacement logic not implemented for param tables Parameter "series"
2 participants