-
Notifications
You must be signed in to change notification settings - Fork 12
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
future: Rename 'state' from `"succeeded" to "finished" #245
Comments
Hi @HenrikBengtsson, Unfortunately, the "succeeded" state does not come from Also, this change is highly likely to break user pipelines: a child job may be waiting for a "succeeded" response from a parent job before executing. We would greatly appreciate it if you could keep the exception in place! Would that be possible? If not, there are a few things we could do:
Do you have a preference? Or maybe another suggestion for how to resolve this issue? |
Update
so that the correct string in stored. |
I've created futureverse/future#667 for improving on the documentation around the internal
To further clarify my previous comment. If you'd like to record the state returned by the Civis API, you are free to store those in your own custom field, say, Without knowing or having access to the Civis API, my best guess would be to map:
I don't know what Civis states As I mention in futureverse/future#667, I might revisit the need for future states |
Was this comment retracted/deleted? I got an email notification, but I
cannot see it online. /Henrik
…On Mon, Feb 13, 2023 at 4:35 PM pcooman ***@***.***> wrote:
I'm sorry, I'm not sure I understand. Are you suggesting I do something
like this?
resolved.CivisFuture <- function(future, ...){
if (!is.null(future$job$containerId)) {
future$state <- scripts_get_containers_runs(id = future$job$containerId,
run_id = future$job$id)$state
}
if (future$state == "succeeded") future$state <- "finished"
future$state %in% c("finished", "failed", "cancelled")
}
Is there a way for the future to be recognized as resolved, but still
have "succeeded" as its final state? I expect a lot of users have pipelines
like:
task_1 <- CivisFuture(...)
if (task_1$state == "succeeded") {
task_2 <- CivisFuture(...)
}
so setting the state to "finished" will cause these to break.
Also, could you please clarify how the signalConditions () function will
change? Is the plan to just take out "succeeded", changing this line
<https://github.com/HenrikBengtsson/future/blob/d1218528b26871ba8d5bbf5d666d266adcf781e9/R/signalConditions.R#L30>
to
if (!future$state %in% c("finished", "failed")) {
or to remove the whole block (lines 30-36)?
Thank you!
—
Reply to this email directly, view it on GitHub
<#245 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMKXUQRWZQIQPETMLJGS6DWXLHNBANCNFSM6AAAAAAT6ULL5M>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Yes, I deleted it after I saw your earlier comment. |
For now, I set an upper bound for the This is a temporary solution, as we are discussing internally on how to make this change without breaking user pipelines. Defining a new "civis_state" field would be a breaking change, that would require a major version update (to v4.0.0), so we are exploring possible alternative approaches. I don't want this to hold up your work on the |
I suspect this might cause more problems for users. I'm not sure, but I think it'll also break my revdep checks when I update future. I'm also not sure CRAN supports that - I'm not aware of any other packages that done that.
Thanks for moving forward. However, I honestly don't understand the problem. Standard encapsulation techniques should allow you to use whatever name is needed. If I can do: ## FIXME: civis::CivisFuture uses 'succeeded' /HB 2019-06-18
if (!future$state %in% c("finished", "failed", "succeeded")) {
...
} in the future package, I don't see why you do similar thinkgs in the civis package instead. Or, are you saying you have server code that rely on the field |
v3.1.0 was approved and is now available on CRAN (here). This version deprecates the "local" argument in CivisFuture and adds new API endpoints. It does still have the upper bound of For a more permanent solution, I made (and merged) a new PR here to map the "succeeded" status we get from the Civis API to a "finished" |
@HenrikBengtsson, Please let me know if there is anything else that may be preventing you from making the desired changes on your end! |
I ran it through my revdep checks, and it looks good now. Thanks. |
Hi, I'm doing more cleanups on the future package and I noticed that you use
"succeeded"
to denote that a CivisFuture has finished successfully, e.g.https://github.com/search?q=repo%3Acivisanalytics%2Fcivis-r%20succeeded&type=code
However, elsewhere in the future ecosystem, we use
"finished"
for this state. Could you please update your package accordingly? Looking at the above search, it could be that:is all that you need to do.
Updating this would help me remove a hard-coded special case for civis in the future package;
Thank you
The text was updated successfully, but these errors were encountered: