File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -773,7 +773,8 @@ def sample_metadata(
773773 for on , data in self ._extra_metadata :
774774 df_samples = df_samples .merge (data , how = "left" , on = on )
775775
776- # Apply the sample_query or sample_indices, if specified.
776+ # Apply the sample_query, if there is one.
777+ # Note: this might have been internally modified, e.g. `is_surveillance == True`.
777778 if prepared_sample_query is not None :
778779 # Assume a pandas query string.
779780 sample_query_options = sample_query_options or {}
@@ -782,7 +783,10 @@ def sample_metadata(
782783 prepared_sample_query , ** sample_query_options , engine = "python"
783784 )
784785 df_samples = df_samples .reset_index (drop = True )
785- elif sample_indices is not None :
786+
787+ # Apply the sample_indices, if there are any.
788+ # Note: this might need to apply to the result of an internal sample_query, e.g. `is_surveillance == True`.
789+ if sample_indices is not None :
786790 # Assume it is an indexer.
787791 df_samples = df_samples .iloc [sample_indices ]
788792 df_samples = df_samples .reset_index (drop = True )
You can’t perform that action at this time.
0 commit comments