def fake_date(end_date=None):
    fake = Faker()
    date_pattern = ['%Y', '%m', '%d']
    if random.choice([True, False]):
        date_pattern.pop()
        if random.choice([True, False]):
            date_pattern.pop()
    return fake.date('-'.join(date_pattern), end_datetime=end_date)
def fake_date(end_date=None):
    fake = Faker()
    date_pattern = ['%Y', '%m', '%d']
    if random.choice([True, False]):
        date_pattern.pop()
        if random.choice([True, False]):
            date_pattern.pop()
    return fake.date('-'.join(date_pattern), end_datetime=end_date)