class_docstr: Percent of 'Null' values in each column.
  
  Parameters
  ----------
  columns : Union[Hashable, List[Hashable]] , default: None
      List of columns to check, if none given checks
      all columns Except ignored ones.
  ignore_columns : Union[Hashable, List[Hashable]] , default: None
      List of columns to ignore, if none given checks
      based on columns variable.
  max_features_to_show : int , default: 5
      maximum features with to show, showing top features based on percent of nulls.
  aggregation_method: t.Optional[str], default: 'max'
      {feature_aggregation_method_argument:2*indent}
  n_samples : int , default: 100_000
      number of samples to use for this check.
  random_state : int, default: 42
      random seed for all check internals.
class_docstr_tok: ["Percent","of","'Null","'","values","in","each","column",".","Parameters","--","--","--","--","--","columns",":","Union","[","Hashable",",","List","[","Hashable","]","]",",","default",":","None","List","of","columns","to","check",",","if","none","given","checks","all","columns","Except","ignored","ones",".","ignore_columns",":","Union","[","Hashable",",","List","[","Hashable","]","]",",","default",":","None","List","of","columns","to","ignore",",","if","none","given","checks","based","on","columns","variable",".","max_features_to_show",":","int",",","default",":","5","maximum","features","with","to","show",",","showing","top","features","based","on","percent","of","nulls",".","aggregation_method",":","t.Optional","[","str","]",",","default",":","'max'","{","feature_aggregation_method_argument:2","*","indent","}","n_samples",":","int",",","default",":","100_000","number","of","samples","to","use","for","this","check",".","random_state",":","int",",","default",":","42","random","seed","for","all","check","internals","."]
docstr: Run check logic.
docstr_tok: ["Run","check","logic","."]
code: def run_logic(
      self, context: Context, dataset_kind: DatasetKind
  ) -> CheckResult:
      """Run check logic."""
      dataset = context.get_data_by_kind(dataset_kind).sample(
          self.n_samples, random_state=self.random_state
      )
      dataset = dataset.select(
          self.columns, self.ignore_columns, keep_label=False
      )
      data = dataset.features_columns
  
      feature_importance = (
          context.feature_importance
          if context.feature_importance is not None
          else pd.Series(index=list(data.columns), dtype=object)
      )
  
      result_data = [
          [col, data[col].isna().sum(), feature_importance[col]]
          for col in data.columns
      ]
      result_data = pd.DataFrame(
          data=result_data,
          columns=[
              "Column",
              "Percent of nulls in sample",
              "Feature importance",
          ],
      ).set_index(["Column"])
      result_data["Percent of nulls in sample"] = (
          result_data["Percent of nulls in sample"] / dataset.n_samples
      )
      result_data.sort_values(by="Percent of nulls in sample")
      if all(feature_importance.isna()):
          result_data.drop("Feature importance", axis=1, inplace=True)
  
      if (
          context.with_display
          and max(result_data["Percent of nulls in sample"]) > 0
      ):
          display = [
              px.bar(
                  x=data.columns,
                  y=result_data["Percent of nulls in sample"],
                  title="Percent Of Nulls",
                  range_y=(0, 1),
              ).update_layout(yaxis_title=None, xaxis_title=None)
          ]
      else:
          display = None
  
      return CheckResult(
          value=result_data, display=display, header="PercentOfNulls"
      )
  
file_path: deepchecks/deepchecks/tabular/checks/data_integrity/percent_of_nulls.py
imports: import typing
  import pandas
  import plotly.express
  from deepchecks.core.check_result import CheckResult
  from deepchecks.core.checks import DatasetKind
  from deepchecks.core.condition import ConditionCategory, ConditionResult
  from deepchecks.core.reduce_classes import ReduceFeatureMixin
  from deepchecks.tabular import Context, SingleDatasetCheck
  from deepchecks.tabular._shared_docs import docstrings
  from deepchecks.tabular.utils.messages import get_condition_passed_message
  from deepchecks.utils.strings import format_percent
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 2 for calling the PercentOfNulls obj's underlying member method code with example usage: obj.run_logic(context, dataset_kind) and returns: CheckResult