Changes:
- Introduced upper bound on
tenacity
version to avoid breaking retrying mechanism.
Changes:
- Updated Apps API-related
TolokaClient
andAsyncTolokaClient
methods to support new features.
Python versions support:
- Python 3.7 support dropped
Changes:
- Updated
TolokaClient.create_app_items
andAsyncTolokaClient.create_app_items
to return the list of created app items ids. - Added
tier
parameter toTolokaClient.create_pool
andAsyncTolokaClient.create_pool
methods.
Bugfixes:
- Fixed OAuth authorization header generation.
Changes:
- Changed streaming cursors behavior: now events are processed not sooner than
time_lag
seconds after they were created. This parameter is configurable, but it is not recommended to decrease the default value of 1 minute as this can lead to some events being skipped. This change affects streaming cursors, cursor-based streaming observers, and some cursor-based metric collectors.
Features:
- Supported SSO authorization tokens.
- Added Python 3.11 support
TolokaClient.create_task
,TolokaClient.create_task_suite
andTolokaClient.create_user_bonus
now supportoperation_id
parameter.
Fixes:
TolokaClient.create_task
,TolokaClient.create_task_suite
,TolokaClient.create_user_bonus
andTolokaClient.create_user_bonus
can be safely retried now (previously they could create duplicate items in case of an unstable connection).- Previously
AsyncTolokaClient
could not outlive the asyncio event loop which was used during the first API call, which lead to an inability to pickleAsyncTolokaClient
. NowAsyncTolokaClient
survives asyncio event loop change. TolokaClient
andAsyncTolokaClient
followsurllib3
retrying behavior more closely in case of theRetry
object being passed to theretry
orretryer_factory
parameters.- Previously streaming cursors could skip some Toloka events when fetching them from the API concurrently with them being created. Now streaming cursors utilize time lag to prevent such concurrent reads.
Features:
- Added
verify
parameter toTolokaClient
andAsyncTolokaClient
. This parameter controls SSL certificate verification settings.
Bugfixes:
- Fixed deserialization of legacy Toloka projects bug which was caused by an attempt to parse view spec with empty
lock
field.
Bugfixes:
- Removed upper bound on
cattrs
version. - While structuring objects with unknown
spec_value
corresponding classes are generated in runtime now. Thus objects like filters, rule actions and others that are not fully documented in api/experimental/removed in past from toloka-kit could be safely structured now.
Bugfixes:
- Methods for the batch creation of tasks, task suites or user bonuses could create duplicate items in case of unstable connection:
TolokaClient.create_tasks_async
,TolokaClient.create_task_suites_async
andTolokaClient.create_user_bonuses_async
as well asTolokaClient.create_tasks
,TolokaClient.create_task_suites
withasync_mode=True
now guaranteed to create not more than one batch of items for a single function call.TolokaClient.create_user_bonuses
andTolokaClient.create_user_bonus
are guaranteed to create not more than one batch of items for a single function call but may raise an exception if there was an attempt to create the same batch of items for the second time due to the unstable connection.
Features:
- Introduced
batch_size
parameter toTolokaClient.get_*
methods family. This parameter can be used to control the items limit for every underlying request that is made while iterating.
Deprecated:
- CAPTCHA frequency and CAPTCHA-based quality control settings are deprecated and will be removed in the future. CAPTCHAs are now included automatically for better quality control.
Bugfixes:
AsyncTolokaClient
can be serialized and deserialized with pickle now.
Features:
AsyncTolokaClient
rework. PreviouslyAsyncTolokaClient
was a simple wrapper overTolokaClient
that provided asynchrony via threading. This lead to poor performance and instability in the case of many concurrent connections. With the current release,AsyncTolokaClient
is implemented with native python async code andhttpx
async networking provider internally, fixing all the above problems.
Deprecated:
- All
AsyncTolokaClient
methods returning generators now return async generators. Currently, the old (synchronous) iteration syntax is still supported via an adapter, but we encourage you to switch to the new (asynchronous) one. Example:
async_toloka_client = AsyncTolokaClient(...)
# deprecated syntax, support will be dropped in the feature
for assignment in await async_toloka_client.get_assignments(...):
...
# recommended syntax
async for assignment in async_toloka_client.get_assignments(...):
...
Changes:
- Toloka-Kit now internally uses
httpx
library instead ofrequests
.
Bug fixes:
TolokaClient.create_task_suites
now returns response of the correct type.
Features:
Pipeline
class can be manually iterated now usingPipeline.run_manually
method.Pipeline
now supportsiteration_mode
parameter, which controls whether the new iteration will start only after the completion of all tasks.
Features:
- Some filters now support inversion using "~" operator.
- Improved error messages.
- Added new
Verified
filter.
Bug fixes:
- Filters created using Toloka-Kit now should be rendered correctly in the Toloka UI.
Languages.include
now works correctly in case of multiple languages being passed.
Breaking changes:
-
By default only the core version of the package with minimized dependencies size is installed. The following objects were extracted into package extras:
TolokaClient.get_assignments_df
method now requirestoloka-kit[pandas]
;toloka.metrics.jupyter_dashboard
module now requirestoloka-kit[jupyter-metrics]
;ZooKeeperLocker
class now requirestoloka-kit[zookeeper]
installed;S3Storage
class now requirestoloka-kit[s3]
.
To install all optional dependencies (the same behavior as in pre-1.0.0 releases) use
toloka-kit[all]
. -
SubmittedAssignmentsCountPoolAnalytics
class is renamed toSubmitedAssignmentsCountPoolAnalytics
.
Features:
TolokaClient.wait_operation
now shows progress bar of submitted operation. This behavior can be disabled with thedisable_progress=True
parameter.- Supported
infer_data_spec
option inTemplateBuilderViewSpec
. This option allows you to control whether data specifications will be inferred from the provided view spec or not. - New
autoquality
usage example. - New verified languages in the
Languages
filter. - New
TolokaClient
option:act_under_account_id
. This option allows you to act using a shared account without a token of this account. - New
TolokaClient
methods:TolokaClient.find_operations
andTolokaClient.get_operations
. These methods allow you to list operations in the same way as the otherfind_*
andget_*
methods. - New
TolokaClient.get_user
method which allows you to get information about one specific Toloker. - Massive improvements in documentation.
Changes:
- https://toloka.dev and https://sandbox.toloka.dev domains are now used for the API requests.
Features:
- Added
toloka.autoquality
- a tool for autogeneration of quality control rules - Added
speed_quality_balance
attribute toPool
Fixes:
- Fix add new observers error.
Fixes:
- Status code 409 is no longer retried by default.
- Status code 504 is now retried by default.
- Fixed bug when
AppItem.errors
have been structured incorrectly. - Fixed the bug when an incorrect version of the
urllib3
was used.
Changes:
toloka.client.filters.Rating
was removed according to changes in Toloka API.- All time data now have a UTC timezone by default (instead of a local timezone).
Streaming improvements:
toloka.streaming.Pipeline
now supports "gentle shutdown": the first SIGINT received will force thePipeline
to process all observers in the current iteration and then exit. On the second SIGINT received, thePipeline
will be interrupted (warning: this may lead to errors such as incorrect saved observers states).toloka.streaming.Pipeline
now supports registering new observers during execution.- Observers now support
delete
,disable
, andenable
methods: these methods change the target Observer state such thattoloka.streaming.Pipeline
handles it accordingly.
Other improvements:
- Added MapView Template Builder component.
Python versions support:
- Python 3.10 support added
- Python 3.6 support dropped
Improvements:
- Added native support for verfied language skills
- Added native support for map provider's selection for pedestrian tasks in
AssignmentsIssuingViewConfig
- Improved default status code dependent retry policies
- Requests originated from
toloka.streaming
ortoloka.metrics
are now marked with additional headers. This makes it easier for us to collect these features' usage statistics - Annotations now use
urllib3
instead of weirdrequests.packages.urllib3
- Actualized outdated docstrings in
toloka.client.user_bonus
Fixes:
- Fixed uninitialized
start_soon
. See #48 - New
metrics
example
Fixes:
- Fixed maximum recursion depth exceptions
- Fixed
download_attachment
Yanked due to issues found in retries functionality:
- Might raise maximum recursion depth exceptions
- Breaks
download_attachment
Fixed intoloka-kit==0.1.21
Features:
-
Retries should work not only while establishing connection to server but also when transfering data
-
Added functional tests against production environment
-
Fixed
TemplateBuilder
structure method issue with attributes annotated byListBaseComponent
-
TolokaClient method names are passed in request headers. This allows usage analytics for complex features such as
clone_project
orget_assignments
that call subsequent TolokaClient methods. -
Now you can track 11 metric types from Toloka with minimal latency.
-
AsyncTolokaClient introduced (experimental)
-
Streaming state storage introduced (experimental)
- Added
from_json
andto_json
convenience functions toBaseTolokaObject
- Added docstrings for Toloka App API client part
- Supported classes with
async def __call__(...)
as streaming handlers inherit_docstrings
decorator preserves__init__
positional arguments orderingTolokaClient
is now pickleable
- Fixed an exceptions caused by returning status 204 with an empty body from API
- Fixed several bugs in toloka apps methods
- Reverted from
PreloadingHTTPAdapter
toHTTPAdapter
- Fixed
get_app_items()
signature
- Added methods to use toloka apps
- Used
PreloadingHTTPAdapter
instead ofHTTPAdapter
- Downgraded attrs dependency from
attrs>=21.2.0
toattrs>=20.3.0
. See #37 - Cursor states are now updated after all callbecks are run successfully (toloka.straming)
- String values passed for Enum-annotated arguments are now automatically converted to Enums
toloka.client
objects are not serializable- Metrics are introduced
- Streaming library to build pipelines
- Examples refactoring
- Added new template builder components
- Added the ability to translate project title and description into multiple languages
- ExtendableStrEnum class has been added for forward compatibility with new enumeration keys
- Added new
TemplateBuilder
components - Deleted
name
fromUserSkillSearchRequest
- Passing
Retry
object intoTolokaClient.retries
is now deprecated. Use newTolokaClient.retryer_factory
argument instead. - Added
__all__
to stub files - Fixed an exception raising when opening an open pool
- Fixed
TemplateBuilder
view-components bug with the disappearance of thehint
,label
andvalidation
fields in0.1.10
version.
TemplateBuilder
components now support positional arguments- Added
readonly
flag to attributes - Added
ACCEPT_AFTER_REJECT
value toAssessmentEvent.Type
- Added
assignment_id
attribute toUserBonusSearchRequest
- Improved stub files formatting
- Improved support by static analyzers
- Added default value for
Pool.defaults
attribute - Added default value 0 for
real_tasks_count
,golden_tasks_count
,training_tasks_count
inMixerConfig
- Added default value
AUTOMATED
forProject.assignments_issuing_type
attribute - Simplified
TolokaPluginV1
' interface by expandinglayout
attribute - Simplified
TemplateBuilderViewSpec
's interface by expandingconfig
attribute - Fixed an issue with
TemplateBuilder
config displayed in one line in Toloka's web interface City
,Languages
,RegionByPhone
andRegionByIp
filters now haveinclude
andexclude
. Thix methods will eventually replace misleadingin_
andnot_in
method names. As for now, all variants are available for backward compatibility- Retry Toloka quotas. Minute quotas are retried by default. And you can turn on the retrying of hourly and daily quotas.
- Added
get_aggregated_solutions
method - Supported webhooks related methods
- Tracebacks in expanded methods do not show confusing TypeError as an original exception
- Fixed error on ARRAY_JSON typed fields specs structuring
- Improved docstrings
- Supported list of statuses as valid argument for
get_assignments
andget_message_threads
- Fixed
help
on filter classes with overlloaded__eq__
- Added
YandexDiskProxyHelperV1
component for template builder - TolokaClient can now be created with url
- Added
__all__
for modules - Created objects' urls are now logged under INFO level, if possible
Fixing issues with create_tasks
and create_task_suites
- Implemented a
clone_project
method - Deserialization should not fail on unknown enum values or unexpected value types anymore
- Some functions that used to return an Operation object now wait for operations to end and return a more useful output. For example,
clone_pool
now returns an instance of Pool representing a newly created pool. If you want the old behavior please use*_async
versions of the methods. The list of affected methods:- archive_pool
- archive_project
- archive_training
- clone_pool
- clone_training
- close_pool
- close_pool_for_update
- close_training
- open_pool
- open_training
create_tasks
andcreate_task_suites
methods now use their async versions under the hood. This significantly reduces cases when TimeoutError is raised but the data is actually uploaded- Added minimal attrs version
- Added WEARABLE_COMPUTER to DeviceCategory enum
- Fixed current_location naming in CoordinatesSpec
- Added support for trainings
- Introduced
get_assignments_df
method
- Introduced template builder support
- Introduced
get_analytics
method - Sensitive values such as rewards and bonuses are now represented as decimal.Decimal