All notable changes to the LaunchDarkly Python SDK will be documented in this file. This project adheres to Semantic Versioning.
9.8.0 (2024-10-16)
9.7.2 (2024-10-01)
- Set explicit names for each spawned thread (#311) (9c7777c)
- Shutdown diagnostic thread if enabled (#312) (cde6cfb)
9.7.1 (2024-08-26)
9.7.0 (2024-08-20)
9.6.0 (2024-08-19)
9.5.0 (2024-07-25)
This release introduces the ability to enable compression of event payloads. When enabled, the SDK will compress events before sending them to the LaunchDarkly servers. This can reduce the bandwidth required to send events, which can be useful in high-traffic environments to reduce egress traffic costs.
Important
Relay Proxy users MUST upgrade to version 8.9 or higher prior to enabling this option to prevent loss of event data.
However, enabling this feature is NOT required when using the Relay Proxy as it will manage compression automatically.
9.4.0 (2024-04-29)
9.3.1 (2024-04-04)
9.3.0 (2024-03-14)
- Inline contexts for all evaluation events (#245) (8b5429b)
- Redact anonymous attributes within feature events (#246) (4022ee2)
9.2.2 (2024-03-07)
9.2.1 (2024-03-01)
- Add example output for PROVENANCE.md #268 (43cf5bf)
- Fix version generation in PROVENANCE file (#272) (7dd887e)
9.2.0 (2024-02-14)
- Enable gzip Accept-Encoding header on polling requests (2c2e4fa)
- deps: Update flask requirement from 2.2.5 to 3.0.0 (#250) (b3cc0fa)
- deps: Update flask requirement from 3.0.0 to <4 (#254) (dc5a6ba)
- deps: Update jinja2 requirement from 3.0.0 to 3.1.2 (77a1f76)
- deps: Update jinja2 requirement from 3.1.2 to 3.1.3 (#252) (495604b)
- deps: Update mypy requirement from ==0.910 to ==1.8.0 (#251) (cea865e)
- deps: Update pytest-mypy requirement from ==0.8.1 to ==0.10.3 (#249) (f2e2e17)
- deps: Update sphinx requirement from ^1.3.0 to ^6.0.0 (77a1f76)
- deps: Update sphinx requirement from ^6.0.0 to >=6,<8 (#255) (d4eb5af)
- deps: Update sphinx-rtd-theme requirement from ^1.3.0 to >=1.3,<3.0 (#253) (ba2490d)
- Update missing version number change (#238) (7efedc8)
9.1.0 (2023-12-20)
- Add data source status provider support (#228) (f733d07)
- Add support for data store status monitoring (#252) (57ca6ac)
- Introduce flag change tracker api (#229) (4df1762)
- Replace internal es implementation with launchdarkly-eventsource package (#254) (99aafd5)
- deps: Bump jsonpickle to fix CVE-2020-22083 (#234) (6280fe8)
- deps: Bump pyyaml to fix CVE-2020-1747 (#236) (48291ec)
- Fix data store availability status check (#237) (81e2910)
- Replace deprecated
utcfromtimestamp
usage.
- Replace deprecated
utcfromtimestamp
usage.
The latest version of this SDK supports the ability to manage migrations or modernizations, using migration flags. You might use this functionality if you are optimizing queries, upgrading to new tech stacks, migrating from one database to another, or other similar technology changes. Migration flags are part of LaunchDarkly's Early Access Program. This feature is available to all LaunchDarkly customers but may undergo additional changes before it is finalized.
For detailed information about this version, refer to the list below. For information on how to upgrade from the previous version, read the migration guide.
- A new
Migrator
type which provides an out-of-the-box configurable migration framework. - For more advanced use cases, added new
migration_variation
andtrack_migration_op
methods onLDClient
.
- Raised
pyyaml
dependency to>=5.3
.
- Python 3.7 support was removed.
- The legacy user format for contexts is no longer supported. To learn more, read the Contexts documentation.
- Methods which originally took a
Context
or adict
now only accept aContext
. - Previously deprecated config options
user_cache_size
,user_cache_time
,user_keys_capacity
,user_keys_flush_interval
, andprivate_attribute_names
have been removed. - Previously deprecated test data flag builder method
variation_for_all_users
has been removed.
- Creating an
LDContext
using the legacy user format has been deprecated and will be removed in the next major release. To learn more, read the Contexts documentation. - Providing client methods
track
,identify
,variation
,variation_detail
,all_flags_state
, andsecure_mode_hash
with a context dictionary is deprecated. In the next major release, aContext
will be required.
- Loosened urllib3 requirement to <3
- Recoverable errors are logged as a warning not an error. (Thanks, fritzdj!)
- Loosened the requirements on the semver package. (Thanks, hauntsaninja!)
- Password will be redacted from redis URL prior to logging.
- Updated usage of
HTTPResponse.getheader
to remove deprecation warning from upstreamurllib3
package. (Thanks, mnito!)
- Pinned urllib3 dependency to <2. (Thanks, prpnmac!)
- Fixed indexing error raised by calling
all_flags_state
while using theTestData
data source.
- Fixed indexing error raised by calling
all_flags_state
while using theTestData
data source.
- Introduced support for an
application
config property which sets application metadata that may be used in LaunchDarkly analytics or other product features. This does not affect feature flag evaluations.
- Introduced support for an
application
config property which sets application metadata that may be used in LaunchDarkly analytics or other product features. This does not affect feature flag evaluations.
The latest version of this SDK supports LaunchDarkly's new custom contexts feature. Contexts are an evolution of a previously-existing concept, "users." Contexts let you create targeting rules for feature flags based on a variety of different information, including attributes pertaining to users, organizations, devices, and more. You can even combine contexts to create "multi-contexts."
For detailed information about this version, please refer to the list below. For information on how to upgrade from the previous version, please read the migration guide.
- In
ldclient
, theContext
type defines the new context model. - For all SDK methods that took a user parameter in the form of a
dict
, you can now pass aContext
instead. You can still pass adict
containing user properties, in which case the SDK will convert it to aContext
transparently; however,Context
is preferable if you value efficiency since there is some overhead to this conversion. - The
TestData
flag builder methods have been extended to support now context-related options, such as matching a key for a specific context type other than "user".
- It was previously allowable to set a user key to an empty string. In the new context model, the key is not allowed to be empty. Trying to use an empty key will cause evaluations to fail and return the default value.
- There is no longer such a thing as a
secondary
meta-attribute that affects percentage rollouts. If you set an attribute with that name in aContext
, it will simply be a custom attribute like any other. - The
anonymous
attribute is now a simple boolean, with no distinction between a false state and a null/undefined state. Previously, a flag rule likeanonymous is false
would not match if the attribute was undefined, but now undefined is treated the same as false.
- The minimum Python version is now 3.7.
- The SDK can now evaluate segments that have rules referencing other segments.
- Analytics event data now uses a new JSON schema due to differences between the context model and the old user model.
- Several optimizations within the flag evaluation logic have improved the performance of evaluations. For instance, target lists are now stored internally as sets for faster matching.
- Removed all types, properties, and methods that were deprecated as of the most recent 5.x release.
- Removed the deprecated
ldclient.flag
module. This was previously an alternate way to import theEvaluationDetail
type; now, you can only import that type fromldclient.evaluation
. - The
alias
method no longer exists because alias events are not needed in the new context model. - The
inline_users_in_events
option no longer exists because it is not relevant in the new context model.
- Publishing this package now includes a pre-built wheel distribution in addition to the customary source distribution.
- A new
redis_opts
parameter is available when configuring a Redis feature or Big Segment store. This parameter will be passed through to the underlying redis driver, allowing for greater configurability. (Thanks, danie1k!)
- Our previous attempt at adding mypy type checking support missed the inclusion of the required py.typed file. (Thanks, anentropic!)
- Removed upper version restriction on expiringdict. This was originally necessary to allow compatibility with older Python versions which are no longer supported.
- Added py.typed file to indicate typing support. Thanks @phillipuniverse
- Fixed invalid operator in key in TestData.
- Fixed bucketing logic to not treat boolean values as bucketable value types.
TestData
, in the new moduleldclient.integrations.test_data
, is a new way to inject feature flag data programmatically into the SDK for testing—either with fixed values for each flag, or with targets and/or rules that can return different values for different users. Unlike the file data source, this mechanism does not use any external resources, only the data that your test code has provided.
- CI builds now include a cross-platform test suite implemented in https://github.com/launchdarkly/sdk-test-harness. This covers many test cases that are also implemented in unit tests, but may be extended in the future to ensure consistent behavior across SDKs in other areas.
- The SDK no longer uses the deprecated method
threading.Condition.notifyAll()
. (Thanks, jdmoldenhauer!) - A rule clause that uses a date operator should be considered a non-match, rather than an error, if either value is
None
. - A rule clause that uses a semver operator should be considered a non-match, rather than an error, if either value is not a string.
- Rules targeting the
secondary
attribute will now reference the correct value. - The
identify
method should not emit an event if the user key is an empty string. - Do not include
prereqOf
field in event data if it is null. This is done to save on event transfer bandwidth. - Data from
all_flags_state
was always including the flag's version even when it was unnecessary. - Any base URIs set in
Config
will work consistently whether they have trailing slashes or not. - When using
all_flags_state
to produce bootstrap data for the JavaScript SDK, the Python SDK was not returning the correct metadata for evaluations that involved an experiment. As a result, the analytics events produced by the JavaScript SDK did not correctly reflect experimentation results. - Data from
all_flags_state
was always including the flag's version even when it was unnecessary.
- The SDK now supports evaluation of Big Segments. See: https://docs.launchdarkly.com/home/users/big-segments
- Added CI testing for Python 3.10.
- In streaming mode, the SDK could sometimes fail to receive flag data from LaunchDarkly if the data contained characters that are not in the Basic Latin character set. The error was intermittent and would depend on unpredictable factors of speed and network behavior which could cause the first byte of a multi-byte UTF8 character to be processed before the rest of the bytes had arrived.
- Fixed some irregularities in the SSE parsing logic used for stream data. The SDK's CI tests now include a more thorough test suite for SSE behavior that is implemented in https://github.com/launchdarkly/sse-contract-tests, to ensure that it is consistent with other LaunchDarkly SDKs.
- The SDK now supports the ability to control the proportion of traffic allocation to an experiment. This works in conjunction with a new platform feature now available to early access customers.
- Added the
alias
method toLDClient
. This can be used to associate two user objects for analytics purposes with an alias event.
- The SDK could fail to send debug events when event debugging was enabled on the LaunchDarkly dashboard, if the application server's time zone was not GMT.
- The logic for detecting uWSGI did not account for undocumented behavior in some environments where the
uwsgi
module is present in an incomplete state; this could cause an error on startup in such environments. Also, the log message about threading options related to uWSGI contained a broken link. (Thanks, andrefreitas!)
This major release is for Python compatibility updates and removal of deprecated APIs. It introduces no new functionality except type hints.
- Added type hints to all SDK methods. Python by itself does not enforce these, but commonly used development tools can provide static checking to trigger warnings or errors if the wrong type is used.
- Python 2.7, 3.3, and 3.4 are no longer supported. The minimum Python version is now 3.5.
- The first parameter to the
Config
constructor,sdk_key
, is now required. Previously it was possible to omit thesdk_key
from theConfig
and specify it separately when initializing the SDK. Now, it is always in theConfig
.
- Removed
ldclient.set_sdk_key()
. The correct way to do this now, if you are using the singleton client methodldclient.get()
, is to callldclient.set_config()
with aConfig
object that contains the SDK key. - Removed the optional SDK key parameter from the
LDClient
constructor. You must now provide a configuration parameter of typeConfig
, and set the SDK key within theConfig
constructor:LDClient(Config(sdk_key = "my-sdk-key", [any other config options]))
. Previously, it was possible to specify the SDK key as a single string parameter and omit theConfig
object—LDClient("my-sdk-key")
—although this would cause a deprecation warning to be logged; specifying both a key and aConfig
was always an error. - Removed the individual HTTP-related parameters such as
connect_timeout
from theConfig
type. The correct way to set these now is with theHTTPConfig
sub-configuration object:Config(sdk_key = "my-sdk-key", http = HTTPConfig(connect_timeout = 10))
. - Removed all other types, parameters, and methods that were deprecated as of the last 6.x release.
- The SDK could fail to send debug events when event debugging was enabled on the LaunchDarkly dashboard, if the application server's time zone was not GMT.
- The SDK was not recognizing proxy authorization parameters included in a proxy URL (example:
http://username:password@proxyhost:port
). It will now use these parameters if present, regardless of whether you set the proxy URL programmatically or in an environment variable. (Thanks, gangeli!)
- A problem with the SDK's use of
urllib3.Retry
could prevent analytics event delivery from being retried after a network error or server error. (#143)
- The new
Config
parameterinitial_reconnect_delay
allows customizing of the base retry delay for stream connections (that is, the delay for the first reconnection after a failure; subsequent retries use an exponential backoff). - The new
Config
parameterhttp
and theHTTPConfig
class allow advanced configuration of the SDK's network behavior, such as specifying a custom certificate authority for connecting to a proxy/gateway that uses a self-signed certificate.
- The retry delay for stream connections has been changed as follows: it uses an exponential backoff no matter what type of error occurred (previously, some kinds of errors had a hard-coded 1-second delay), and each delay is reduced by a random jitter of 0-50% rather than 0-100%. Also, if a connection remains active for at least 60 seconds, the backoff is reset to the initial value. This makes the Python SDK's behavior consistent with other LaunchDarkly SDKs.
- The existing
Config
propertiesconnect_timeout
,read_timeout
, andverify_ssl
are now deprecated and superseded by the equivalent properties inHTTPConfig
.
- Setting
verify_ssl
toFalse
in the client configuration did not have the expected effect of completely turning off SSL/TLS verification, because it still left certificate verification in effect, so it would allow a totally insecure connection but reject a secure connection whose certificate had an unknown CA. This has been changed so that it will turn off certificate verification as well. This is not a recommended practice and a future version of the SDK will add a way to specify a custom certificate authority instead (to support, for instance, using the Relay Proxy with a self-signed certificate).
- When diagnostic events are enabled (as they are by default), the SDK was logging spurious warning messages saying "Unhandled exception in event processor. Diagnostic event was not sent. ['DiagnosticEventSendTask' object has no attribute '_response_fn']". The events were still being sent; the misleading message has been removed.
Note: if you are using the LaunchDarkly Relay Proxy to forward events, update the Relay to version 5.10.0 or later before updating to this Python SDK version.
- The SDK now periodically sends diagnostic data to LaunchDarkly, describing the version and configuration of the SDK, the architecture and version of the runtime platform, and performance statistics. No credentials, hostnames, or other identifiable values are included. This behavior can be disabled with the
diagnostic_opt_out
option or configured withdiagnostic_recording_interval
.
- The SDK now specifies a uniquely identifiable request header when sending events to LaunchDarkly to ensure that events are only processed once, even if the SDK sends them two times due to a failed initial attempt.
- In rare circumstances (depending on the exact data in the flag configuration, the flag's salt value, and the user properties), a percentage rollout could fail and return a default value, logging the error "variation/rollout object with no variation or rollout". This would happen if the user's hashed value fell exactly at the end of the last "bucket" (the last variation defined in the rollout). This has been fixed so that the user will get the last variation.
- Changed
Files.new_data_source()
to useyaml.safe_load()
instead ofyaml.load()
for YAML/JSON test data parsing. This disablespyyaml
extended syntax features that could allow arbitrary code execution. (#136)
- Fixed an incompatibility with Python 3.3 due to an unpinned dependency on
expiringdict
. - Fixed usages that caused a
SyntaxWarning
in Python 3.8. (Thanks, bunchesofdonald!) - Updated CI scripts so a
SyntaxWarning
will always cause a build failure, and added a 3.8 build.
- The new
Config
parameterhttp_proxy
allows you to specify a proxy server programmatically rather than by using environment variables. This may be helpful if you want the SDK to use a proxy, but do not want other Python code to use the proxy. (Thanks, gangeli!)
- Since version 6.1.0, the SDK was not respecting the standard
https_proxy
environment variable for specifying a proxy (because that variable is not used byurllib3
). This has been fixed. - In streaming mode, the SDK could fail to apply a feature flag update if it exceeded the LaunchDarkly service's maximum streaming message size; the service uses an alternate delivery mechanism in this case, which was broken in the SDK. This bug was also introduced in version 6.1.0.
- Fixed the generated documentation to exclude special members like
__dict__
.
- Fixed a bug in 6.10.0 that prevented analytics events from being generated for missing flags.
- Added support for upcoming LaunchDarkly experimentation features. See
LDClient.track()
.
- Under conditions where analytics events are being generated at an extremely high rate (for instance, if an application is evaluating a flag repeatedly in a tight loop on many threads), a thread could be blocked indefinitely within
variation
while waiting for the internal event processing logic to catch up with the backlog. The logic has been changed to drop events if necessary so threads will not be blocked (similar to how the SDK already drops events if the size of the event buffer is exceeded). If that happens, this warning message will be logged once: "Events are being produced faster than they can be processed; some events will be dropped". Under normal conditions this should never happen; this change is meant to avoid a concurrency bottleneck in applications that are already so busy that thread starvation is likely.
- Usages of
Logger.warn()
were causing deprecation warnings in some versions of Python. Changed these toLogger.warning()
. (#125)
- Changed the artifact name from
ldclient-py
tolaunchdarkly-server-sdk
- Changed repository references to use the new URL
There are no other changes in this release. Substituting ldclient-py
version 6.9.1 with launchdarkly-server-sdk
version 6.9.2 will not affect functionality.
- The
set_sdk_key
function was comparing the existing SDK key (if any) to the new one by identity (is
) rather than equality (==
). In Python, two strings that have the same characters may or may not be the same string instance; in the case where they were not,set_sdk_key
would inappropriately reinitialize the client even though the SDK key had not really changed. (Thanks, jpgimenez!) - Running the SDK unit tests is now simpler in that the database integrations can be skipped. See
CONTRIBUTING.md
.
The LaunchDarkly SDK repositories are being renamed for consistency. This repository is now python-server-sdk
rather than python-client
.
The package name will also change. In the 6.9.1 release, it is still ldclient-py
; in all future releases, it will be launchdarkly-server-sdk
. No further updates to the ldclient-py
package will be published after this release.
- It is now possible to use the
with
statement on an LDClient object, so thatclose()
will be called automatically when it goes out of scope.
- Calling
close()
on the client would cause an error if the configuration includeduse_ldd=True
. (#118)
- Setting user attributes to non-string values when a string was expected would cause analytics events not to be processed. Also, in the case of the "secondary" attribute, this could cause evaluations to fail for a flag with a percentage rollout. The SDK will now convert attribute values to strings as needed. (#115)
- If
track
oridentify
is called without a user, the SDK now logs a warning, and does not send an analytics event to LaunchDarkly (since it would not be processed without a user).
Note that starting with this release, generated API documentation is available online at https://launchdarkly-python-sdk.readthedocs.io. This is published automatically from the documentation comments in the code.
- The SDK no longer uses
jsonpickle
. - The CI test suite for all supported Python versions, which previously only ran in Linux, has been extended to include Python 3.6 in Windows.
- Corrected and expanded many documentation comments. All public API methods (not including internal implementation details) are now documented.
- Fixed a different packaging error that was still present in the 6.8.1 release, which made the package installable but caused imports to fail. The 6.8.1 release has been pulled from PyPI. We apologize for these recent errors, which were not detected prior to release because our prerelease testing was using the source code directly rather than installing it with
pip
. Our CI tests have been updated and should prevent this in the future.
- Fixed a packaging error that made the 6.8.0 release not installable. There are no other changes. The 6.8.0 release has been pulled from PyPI.
- It is now possible to use Consul as a persistent feature store, similar to the existing Redis and DynamoDB integrations. See
Consul
inldclient.integrations
, and the reference guide for "Storing data".
- It is now possible to use DynamoDB as a persistent feature store, similar to the existing Redis integration. See
DynamoDB
inldclient.integrations
, and the reference guide to "Storing data". - The new class
CacheConfig
(inldclient.feature_store
) encapsulates all the parameters that control local caching in database feature stores. This takes the place of theexpiration
andcapacity
parameters that are in the deprecatedRedisFeatureStore
constructor; it can be used with DynamoDB and any other database integrations in the future, and if more caching options are added toCacheConfig
they will be automatically supported in all of the feature stores.
- The
RedisFeatureStore
constructor inldclient.redis_feature_store
. The recommended way to create a Redis feature store now is to useRedis.new_feature_store
inldclient.integrations
.
- It is now possible to inject feature flags into the client from local JSON or YAML files, replacing the normal LaunchDarkly connection. This would typically be for testing purposes. See
file_data_source.py
.
- The
all_flags_state
method now accepts a new option,details_only_for_tracked_flags
, which reduces the size of the JSON representation of the flag state by omitting some metadata. Specifically, it omits any data that is normally used for generating detailed evaluation events if a flag does not have event tracking or debugging turned on.
- The SDK previously contained a copy of code from the
expiringdict
package. This has been changed to use the current version of that package from PyPi.
- JSON data from
all_flags_state
is now slightly smaller even if you do not use the new option described above, because it omits the flag property for event tracking unless that property is true.
- In polling mode, if the client received an HTTP error from LaunchDarkly, it stopped polling. This has been fixed so it only stops polling if the error is 401 (indicating an invalid SDK key).
- When using a Redis feature store, if the
hgetall
method returned an invalid result,all_flags
andall_flags_state
would throw an exception. Instead,all_flags
will now return an empty dict, andall_flags_state
will return a state object with no flags andvalid==False
. (Thanks, thieman!)
- In Python 3, if the Redis feature store encountered a Redis exception, it would crash on trying to log the
message
property of the exception, which does not exist in Python 3. This has been fixed. (Thanks, mattbriancon!)
- The new
LDClient
methodvariation_detail
allows you to evaluate a feature flag (using the same parameters as you would forvariation
) and receive more information about how the value was calculated. This information is returned in anEvaluationDetail
object, which contains both the result value and a "reason" object which will tell you, for instance, if the user was individually targeted for the flag or was matched by one of the flag's rules, or if the flag returned the default value due to an error.
- When evaluating a prerequisite feature flag, the analytics event for the evaluation did not include the result value if the prerequisite flag was off.
- The new
LDClient
methodall_flags_state()
should be used instead ofall_flags()
if you are passing flag data to the front end for use with the JavaScript SDK. It preserves some flag metadata that the front end requires in order to send analytics events correctly. Versions 2.5.0 and above of the JavaScript SDK are able to use this metadata, but the output ofall_flags_state()
will still work with older versions. - The
all_flags_state()
method also allows you to select only client-side-enabled flags to pass to the front end, by using the optionclient_side_only=True
.
LDClient.all_flags()
- In streaming mode, each connection failure or unsuccessful reconnection attempt logs a message at
ERROR
level. Previously, this message included the amount of time before the next retry; since that interval is different for each attempt, that meant theERROR
-level messages were all unique, which could cause problems for monitors. This has been changed so theERROR
-level message is always the same, and is followed by anINFO
-level message about the time delay. (Note that in order to suppress the default message, the LaunchDarkly client modifies the logger used by thebackoff
package; if you are usingbackoff
for some other purpose and do want to see the default message, setlogging.getLogger('backoff').propagate
toTrue
.) (#88)
- Removed an unused dependency on the
CacheControl
package.
- The client now uses
urllib3
for HTTP requests, rather than therequests
package. This change was made becauserequests
has a dependency on an LGPL-licensed package, and some of our customers cannot use LGPL code. The networking behavior of the client should be unchanged. - The client now treats most HTTP 4xx errors as unrecoverable: that is, after receiving such an error, it will not make any more HTTP requests for the lifetime of the client instance, in effect taking the client offline. This is because such errors indicate either a configuration problem (invalid SDK key) or a bug in the client, which will not resolve without a restart or an upgrade. This does not apply if the error is 400, 408, 429, or any 5xx error.
- During initialization, if the client receives any of the unrecoverable errors described above,
ldclient.get()
will return immediately; previously it would continue waiting until a timeout. Theis_initialized()
method will return false in this case.
- Fixed a bug introduced in v6.0.3 that caused the user cache for analytics events to never be cleared, also causing an
AttributeError
to appear in the log.
- Removed a dependency on the
pylru
package, because it uses a GPL license.
- Fixed a bug that, in Python 3.x, could cause a timer thread to keep running after the client has been shut down. This bug also caused the message "TypeError: Event object is not callable" to be logged.
- Fixed the
Config
initializer to create a new instance ofInMemoryFeatureStore
if you omit thefeature_store
argument. Previously, allConfig
instances that were created with default parameters would share the same feature store instance. - Clarified HTTP proxy setup instructions in the readme.
- Fixed a bug that caused an error message to be logged (
KeyError: 'default'
) when evaluating a prerequisite flag (and that also prevented an analytics event from being sent for that flag). - When running in uWSGI, the client will no longer log an error message if the
enableThreads
option is absent, as long as thethreads
option has been set to a number greater than 1. (#84)
This release was broken and has been removed.
- To reduce the network bandwidth used for analytics events, feature request events are now sent as counters rather than individual events, and user details are now sent only at intervals rather than in each event. These behaviors can be modified through the LaunchDarkly UI and with the new configuration option
inline_users_in_events
. - The analytics event processor now flushes events at a configurable interval defaulting to 5 seconds, like the other SDKs (previously it flushed if no events had been posted for 5 seconds, or if events exceeded a configurable number). This interval is set by the new
Config
propertyflush_interval
.
- Python 2.6 is no longer supported.
- Removed the
Config
propertyevents_upload_max_batch_size
, which is no longer relevant in the new event flushing logic (see above).
- It was not possible to install the SDK with
pip
10.0.0. This should work now (thanks, @theholy7!) with the latestpip
as well as previous versions.
- Fixed a bug that, in Python 3.x, caused an error when using an integer user attribute to compute a rollout.
- Fixed a bug that, in Python 3.x, made the
all_flags
method return a dictionary with byte-string keys instead of string keys when using the Redis feature store.
- In the Redis feature store, fixed a synchronization problem that could cause a feature flag update to be missed if several of them happened in rapid succession.
- Support for a new LaunchDarkly feature: reusable user segments.
- The
FeatureStore
interface has been changed to support user segment data as well as feature flags. Existing code that usesInMemoryFeatureStore
orRedisFeatureStore
should work as before, but custom feature store implementations will need to be updated.
- Twisted is no longer supported.
This release was broken and has been removed.
- Percentage rollouts can now reference an attribute with an integer value, not just string attributes.
- Fixed a bug that caused unusually slow initialization times when there are large numbers of flags.
- Fixed reporting of events for prerequisite checks.
- Reduced WARN-level logging for a feature flag not being found to INFO level.
- Fixed a bug where a previously deleted feature flag might be considered still available.
- The private attributes feature added in v4.1.0 was not available in Twisted mode; now it is.
- Will use feature store if already initialized even if connection to service could not be established. This is useful when flags have been initialized in redis.
- Allow user to stop user attributes from being sent in analytics events back to LaunchDarkly. Set
private_attribute_names
on each request and/or onConfig
to a list of strings matching the names of the attributes you wish to exclude. Setall_attributes_private
on theConfig
object to hide all attributes.
- Stop reattempting connections when receiving a 401 (unauthorized) response from LaunchDarkly. This should only be caused by invalid SDK key so retrying is pointless.
events_enabled
is deprecated andsend_events
should be used instead.events_enabled
may be removed in a future minor revision.
- Improved error handling when processing stream events
- Replaced 3rd party rfc3339 library for license compliance
- No longer caching
get_one()
responses
- #70 Regex
matches
targeting rules now include the user if a match is found anywhere in the attribute. Before fixing this bug, the beginning of the attribute needed to match the pattern.
- #43 Started publishing code coverage metrics to Code Climate. Bear in mind that the Code Climate coverage report only shows the unit test coverage, while the bulk of our SDK test coverage comes from a separate integration test suite.
- #65 Ensure that no warning is logged about a missing SDK key when the
ldclient
package is imported.
- Fixed missing python2.6-requirements.txt in manifest
- Support for Python 2.6.
- RedisFeatureStore now returns default when Redis errors occur
- Better detection of stream connection issues.
- Changing the config and SDK key is now supported after initialization. The client will be restarted with the new configuration
- Breaking api change:
ldclient.sdk_key = <KEY>
replaced with:ldclient.set_sdk_key('<KEY>')
- Breaking api change:
ldclient.config = config
replaced with:ldclient.set_config(config)
- No longer depend on sseclient library, instead include our own sse client
- Add backoff when retrying stream connection.
- More correct initialized state.
- Better error handling when sending events.
- Now using jsonpickle to serialize analytics events. Addresses #57
- Better handling of indirect/put and indirect/patch messages in streaming connection.
- Twisted support for LDD mode only.
- FeatureStore interface get() and all() methods now take an additional callback parameter.
- Support for multivariate feature flags.
variation
replacestoggle
and can return a string, number, dict, or boolean value depending on how the flag is defined. - New
all_flags
method returns all flag values for a specified user. - New
secure_mode_hash
function computes a hash suitable for the new LaunchDarkly JavaScript client's secure mode feature.
- The
toggle
call has been deprecated in favor ofvariation
.
- Twisted support has temporarily been removed.