Repository: pydantic/pydantic

Issue:
`BeforeValidator` runs twice in case when dataclass
### Initial Checks

- [X] I confirm that I'm using Pydantic V2

### Description

`BeforeValidator` runs twice in case when dataclass.

This is inconvinient when validate input value type before convert like #6045
Is there any way to avoid this issue?

### Example Code

`test.py`:

```Python
from typing import Annotated

from pydantic import BeforeValidator
from pydantic.dataclasses import dataclass


def convert(value: int) -> str:
    print(f"{value=}")
    return str(value)


IntToStr = Annotated[str, BeforeValidator(convert)]


@dataclass
class A:
    a: IntToStr


A(123)
```

Result:

```console
$ python test.py
value=123
value='123'
```

### Python, Pydantic & OS Version

```Text
$ python -c "import pydantic.version; print(pydantic.version.version_info())"
             pydantic version: 2.1.1
        pydantic-core version: 2.4.0
          pydantic-core build: profile=release pgo=true mimalloc=true
                 install path: /workspace/.venv/lib/python3.11/site-packages/pydantic
               python version: 3.11.4 (main, Jul  4 2023, 05:25:16) [GCC 12.2.0]
                     platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.36
     optional deps. installed: ['typing-extensions']
```


Selected Assignee: @davidhewitt


Discussion:

Resolving patch:
diff --git a/pydantic/fields.py b/pydantic/fields.py
--- a/pydantic/fields.py
+++ b/pydantic/fields.py
@@ -419,11 +419,7 @@ def _from_dataclass_field(cls, dc_field: DataclassField[Any]) -> typing_extensio
 
         # use the `Field` function so in correct kwargs raise the correct `TypeError`
         dc_field_metadata = {k: v for k, v in dc_field.metadata.items() if k in _FIELD_ARG_NAMES}
-        field = Field(default=default, default_factory=default_factory, repr=dc_field.repr, **dc_field_metadata)
-
-        field.annotation, annotation_metadata = cls._extract_metadata(dc_field.type)
-        field.metadata += annotation_metadata
-        return field
+        return Field(default=default, default_factory=default_factory, repr=dc_field.repr, **dc_field_metadata)
 
     @classmethod
     def _extract_metadata(cls, annotation: type[Any] | None) -> tuple[type[Any] | None, list[Any]]:


Test patch:
diff --git a/tests/test_dataclasses.py b/tests/test_dataclasses.py
--- a/tests/test_dataclasses.py
+++ b/tests/test_dataclasses.py
@@ -18,6 +18,7 @@
 import pydantic
 from pydantic import (
     BaseModel,
+    BeforeValidator,
     ConfigDict,
     FieldValidationInfo,
     GenerateSchema,
@@ -2466,3 +2467,23 @@ class Model:
         __pydantic_config__ = ConfigDict(schema_generator=LaxStrGenerator)
 
     assert Model(x=1).x == '1'
+
+
+@pytest.mark.parametrize('decorator1', **dataclass_decorators())
+def test_annotated_before_validator_called_once(decorator1):
+    count = 0
+
+    def convert(value: int) -> str:
+        nonlocal count
+        count += 1
+        return str(value)
+
+    IntToStr = Annotated[str, BeforeValidator(convert)]
+
+    @decorator1
+    class A:
+        a: IntToStr
+
+    assert count == 0
+    TypeAdapter(A).validate_python({'a': 123})
+    assert count == 1