Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

janbuchar
Copy link
Contributor

@janbuchar janbuchar commented Feb 6, 2025

@janbuchar janbuchar added the t-tooling Issues with this label are in the ownership of the tooling team. label Feb 6, 2025
@janbuchar janbuchar requested review from vdusek and B4nan February 6, 2025 16:59
@github-actions github-actions bot added this to the 107th sprint - Tooling team milestone Feb 6, 2025
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label Feb 7, 2025
@janbuchar janbuchar marked this pull request as ready for review February 7, 2025 22:16
Copy link
Contributor

@vdusek vdusek left a comment

Choose a reason for hiding this comment

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

Could you please explain it somewhere in the concepts docs?

Starting with: https://docs.apify.com/sdk/python/docs/concepts/actor-lifecycle

@janbuchar
Copy link
Contributor Author

Could you please explain it somewhere in the concepts docs?

Starting with: https://docs.apify.com/sdk/python/docs/concepts/actor-lifecycle

There are docs being written in apify/apify-sdk-js#356 - would you like to check it out so that I can mirror it here afterwards?

Are you sure that the Actor lifecycle page is a good place for this? If monetization belongs there, why not dataset handling, for example?

@vdusek
Copy link
Contributor

vdusek commented Feb 11, 2025

There are docs being written in apify/apify-sdk-js#356 - would you like to check it out so that I can mirror it here afterwards?

Cool, I'll check it out, thanks.

Are you sure that the Actor lifecycle page is a good place for this? If monetization belongs there, why not dataset handling, for example?

Sorry for the confusion. I just linked the first page from the concepts. Unfortunately, the https://docs.apify.com/sdk/python/docs/concepts/ leads to 404. Choose the right location by yourself.

Copy link
Contributor

@vdusek vdusek left a comment

Choose a reason for hiding this comment

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

a few comments... (more will come tomorrow)

Comment on lines +169 to +174
PricingModel: TypeAlias = Literal[
'FREE',
'FLAT_PRICE_PER_MONTH',
'PRICE_PER_DATASET_ITEM',
'PAY_PER_EVENT',
]
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this should be rendered in the docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yet we only get this link which leads nowhere 😕
image

If you know of any other way of annotating ActorPricingInfo.pricing_model that would render in a nicer way, I'm all ears.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, so probably we will have to reach out to @barjin to update the doc tooling 👀.

Copy link
Contributor

@barjin barjin Feb 19, 2025

Choose a reason for hiding this comment

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

Crossposting the convo we had with Honza for more reach (>two heads are better than two):

Do I understand correctly that this is some kind of a sum type of literals (something like an enum, just not an enum)? We render enums in JS like this – I think we can also attach documentation to each member.

I'm not sure how it would work in Python like you have it now, since it's all essentially a single expression… maybe with some of those Annotated generic types? Is there a Pythonic way of documenting each single Literal member?

In any case, as a user, I would appreciate documentation for each PricingModel member, at least with a link to the Apify documentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is analogous to type Foo = "asdf" | "hjkl". An inline list of the possible string values would be the best IMO, we can add the link to the documentation to the pricing_model field.

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, so you cannot use PricingModel.FREE as a runtime value, I got confused by the assignment (sth = Literal[]) syntax. I'll see what I can do regarding the expansion of the type alias to its "value" in the call site doc.

Copy link
Contributor

@vdusek vdusek left a comment

Choose a reason for hiding this comment

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

I would really add a clarifying note to the new events docstring, such as: "Note: Do not confuse these events with system events used by event manager blah blah". Because I am sure someone will get confused in the future since 2 different things are named the same.

Copy link
Contributor

@vdusek vdusek left a comment

Choose a reason for hiding this comment

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

LGTM

@jirispilka
Copy link

Do you think we can close it today? 🙏🏻 I'd like to have it ready for the Agents Hackathon.

@Pijukatel Pijukatel self-requested a review February 19, 2025 11:51
@janbuchar janbuchar merged commit 78888c4 into master Feb 19, 2025
27 checks passed
@janbuchar janbuchar deleted the actor-charge branch February 19, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Actor.charge
6 participants