from typing import Union


def pascals_to_bars(pa: float, unit: str) -> Union[float, str]:
    """
    This function converts Pa to bar
    Wikipedia reference: https://en.wikipedia.org/wiki/Bar_(unit)
    Wikipedia reference: https://en.wikipedia.org/wiki/Pascal_(unit)

    >>> pascals_to_bars(45000, "Pa")
    0.45
    >>> pascals_to_bars("1200000", "Pa")
    12.0
    >>> pascals_to_bars(0, "Pa")
    0.0
    >>> pascals_to_bars(3.1, "mmHg")
    'Invalid unit'
    >>> pascals_to_bars("pass", "Pa")
    Traceback (most recent call last):
    ...
    ValueError: could not convert string to float: 'pass'
    """
    if unit == "Pa":
        bar = float(pa) / 100000
        return bar
    else:
        return "Invalid unit"