class_docstr: Renders the SQL query plan assuming ANSI SQL.
class_docstr_tok: ["Renders","the","SQL","query","plan","assuming","ANSI","SQL","."]
docstr: Render the ratio computation for a ratio metric.
  
  This requires both a type cast to a floating point type (default to DOUBLE, engine-permitting) and
  the requisite division between numerator and denominator
docstr_tok: ["Render","the","ratio","computation","for","a","ratio","metric",".","This","requires","both","a","type","cast","to","a","floating","point","type","(","default","to","DOUBLE",",","engine-permitting",")","and","the","requisite","division","between","numerator","and","denominator"]
code: def visit_ratio_computation_expr(
      self, node: SqlRatioComputationExpression
  ) -> SqlExpressionRenderResult:
      """Render the ratio computation for a ratio metric.
  
      This requires both a type cast to a floating point type (default to DOUBLE, engine-permitting) and
      the requisite division between numerator and denominator
      """
      rendered_numerator = self.render_sql_expr(node.numerator)
      rendered_denominator = self.render_sql_expr(node.denominator)
  
      numerator_sql = (
          f"CAST({rendered_numerator.sql} AS {self.double_data_type})"
      )
      denominator_sql = f"CAST(NULLIF({rendered_denominator.sql}, 0) AS {self.double_data_type})"
  
      bind_parameters = SqlBindParameters()
      bind_parameters = bind_parameters.combine(
          rendered_numerator.bind_parameters
      )
      bind_parameters = bind_parameters.combine(
          rendered_denominator.bind_parameters
      )
  
      return SqlExpressionRenderResult(
          sql=f"{numerator_sql} / {denominator_sql}",
          bind_parameters=bind_parameters,
      )
  
imports: from __future__ import annotations
  import logging
  import textwrap
  from abc import ABC, abstractmethod
  from collections import namedtuple
  from dataclasses import dataclass
  from typing import Collection, List
  import jinja2
  from dbt_semantic_interfaces.type_enums.date_part import DatePart
  from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity
  from typing_extensions import override
  from metricflow.sql.sql_bind_parameters import SqlBindParameters
  from metricflow.sql.sql_exprs import SqlAggregateFunctionExpression, SqlBetweenExpression, SqlCastToTimestampExpression, SqlColumnAliasReferenceExpression, SqlColumnReferenceExpression, SqlComparisonExpression, SqlDateTruncExpression, SqlExpressionNode, SqlExpressionNodeVisitor, SqlExtractExpression, SqlFunction, SqlGenerateUuidExpression, SqlIsNullExpression, SqlLogicalExpression, SqlNullExpression, SqlPercentileExpression, SqlPercentileFunctionType, SqlRatioComputationExpression, SqlStringExpression, SqlStringLiteralExpression, SqlSubtractTimeIntervalExpression, SqlWindowFunctionExpression
  from metricflow.sql.sql_plan import SqlSelectColumn
label_desc: Use image node_id 20 for calling the DefaultSqlExpressionRenderer obj's underlying member method code with example usage: obj.visit_ratio_computation_expr(node) and returns: SqlExpressionRenderResult