diff --git a/python/python/lancedb/embeddings/colpali.py b/python/python/lancedb/embeddings/colpali.py index b2968ff0d..4b614bce3 100644 --- a/python/python/lancedb/embeddings/colpali.py +++ b/python/python/lancedb/embeddings/colpali.py @@ -81,6 +81,7 @@ class ColPaliEmbeddings(EmbeddingFunction): warnings.warn( "use_token_pooling is deprecated, use pooling_strategy=None instead", DeprecationWarning, + stacklevel=2, ) self.pooling_strategy = None diff --git a/python/python/lancedb/remote/db.py b/python/python/lancedb/remote/db.py index e57958958..201be33d5 100644 --- a/python/python/lancedb/remote/db.py +++ b/python/python/lancedb/remote/db.py @@ -124,6 +124,7 @@ class RemoteDBConnection(DBConnection): "request_thread_pool is no longer used and will be removed in " "a future release.", DeprecationWarning, + stacklevel=2, ) if connection_timeout is not None: @@ -132,6 +133,7 @@ class RemoteDBConnection(DBConnection): "release. Please use client_config.timeout_config.connect_timeout " "instead.", DeprecationWarning, + stacklevel=2, ) client_config.timeout_config.connect_timeout = timedelta( seconds=connection_timeout @@ -142,6 +144,7 @@ class RemoteDBConnection(DBConnection): "read_timeout is deprecated and will be removed in a future release. " "Please use client_config.timeout_config.read_timeout instead.", DeprecationWarning, + stacklevel=2, ) client_config.timeout_config.read_timeout = timedelta(seconds=read_timeout) diff --git a/python/python/lancedb/remote/table.py b/python/python/lancedb/remote/table.py index 5a3b5eb19..329baaa0e 100644 --- a/python/python/lancedb/remote/table.py +++ b/python/python/lancedb/remote/table.py @@ -845,7 +845,8 @@ class RemoteTable(Table): """ warnings.warn( "cleanup_old_versions() is a no-op on LanceDB Cloud. " - "Tables are automatically cleaned up and optimized." + "Tables are automatically cleaned up and optimized.", + stacklevel=2, ) pass @@ -857,7 +858,8 @@ class RemoteTable(Table): """ warnings.warn( "compact_files() is a no-op on LanceDB Cloud. " - "Tables are automatically compacted and optimized." + "Tables are automatically compacted and optimized.", + stacklevel=2, ) pass @@ -874,7 +876,8 @@ class RemoteTable(Table): """ warnings.warn( "optimize() is a no-op on LanceDB Cloud. " - "Indices are optimized automatically." + "Indices are optimized automatically.", + stacklevel=2, ) pass diff --git a/python/python/lancedb/table.py b/python/python/lancedb/table.py index 12061df49..3d4cefcb6 100644 --- a/python/python/lancedb/table.py +++ b/python/python/lancedb/table.py @@ -3409,18 +3409,20 @@ class LanceTable(Table): if data_storage_version is not None: warnings.warn( - "setting data_storage_version directly on create_table is deprecated. ", + "setting data_storage_version directly on create_table is deprecated. " "Use database_options instead.", DeprecationWarning, + stacklevel=2, ) if storage_options is None: storage_options = {} storage_options["new_table_data_storage_version"] = data_storage_version if enable_v2_manifest_paths is not None: warnings.warn( - "setting enable_v2_manifest_paths directly on create_table is ", + "setting enable_v2_manifest_paths directly on create_table is " "deprecated. Use database_options instead.", DeprecationWarning, + stacklevel=2, ) if storage_options is None: storage_options = {} @@ -5662,6 +5664,7 @@ class AsyncTable: "The 'retrain' parameter is deprecated and will be removed in a " "future version.", DeprecationWarning, + stacklevel=2, ) return await self._inner.optimize(